Turn off layout for one of action

后端 未结 4 1753
遇见更好的自我
遇见更好的自我 2020-12-08 01:20

My situation: View action of ReportsController should render pure html, but not as a file (to view it in browser and save it after). So for rendering I use view template vie

4条回答
  •  有刺的猬
    2020-12-08 02:26

    Try this:

    ReportsController < ApplicationController
      layout false
      layout 'application', :except => :view
    

提交回复
热议问题