Skip to content

Commit

Permalink
Merge pull request #7574 from NickLaMuro/rails-6-use-relative-paths-f…
Browse files Browse the repository at this point in the history
…or-layouts

[rails6] Use relative paths for layouts
  • Loading branch information
h-kataria authored Jan 26, 2021
2 parents f2535fa + d2f1b4f commit 95e1857
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions app/controllers/application_controller/report_downloads.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def render_pdf_internal(report)
def render_pdf_internal_rr(report, result)
@options = report_print_options(report, result) # used by the layouts/print
render(
:template => '/layouts/print/report',
:layout => '/layouts/print',
:template => 'layouts/print/report',
:layout => 'layouts/print',
:locals => {
:report => report,
:data => result.html_rows.join
Expand Down Expand Up @@ -122,8 +122,8 @@ def print_report

@options = report_print_options(result.report, result) # used by the layouts/print
render(
:template => '/layouts/print/report',
:layout => '/layouts/print',
:template => 'layouts/print/report',
:layout => 'layouts/print',
:locals => {
:report => result.report,
:data => result.html_rows.join
Expand Down Expand Up @@ -231,7 +231,7 @@ def set_summary_pdf_data
end

disable_client_cache
render :template => '/layouts/print/textual_summary', :layout => '/layouts/print'
render :template => 'layouts/print/textual_summary', :layout => 'layouts/print'
end
end
end
4 changes: 2 additions & 2 deletions spec/controllers/application_controller/compare_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@

expect(controller).to receive(:render).with(
hash_including(
:template => '/layouts/print/report',
:layout => '/layouts/print',
:template => 'layouts/print/report',
:layout => 'layouts/print',
:locals => hash_including(
:report # the report does not match due to a ".dup" call in the controller.
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
end

it "returns with print" do
expect(controller).to receive(:render).with(:layout => '/layouts/print', :template => '/layouts/print/textual_summary')
expect(controller).to receive(:render).with(:layout => 'layouts/print', :template => 'layouts/print/textual_summary')
controller.send(:set_summary_pdf_data)
end
end
Expand Down

0 comments on commit 95e1857

Please sign in to comment.