ruby on rails - Turn off layout for one of action -
my situation: view action of reportscontroller should render pure html, not file (to view in browser , save after). rendering use view template view.html.erb , neet turn off layouts action. in other actions of controller layouts should stay untouched. works turning off whole controller this:
reportscontroller < applicationcontroller layout false
but doing wrong :( actions tried use in action:
def view @report = report.new(params[:report]) unless @report.valid? render :action => 'new' , return else render :layout => false end end
what should do?
try this:
reportscontroller < applicationcontroller layout false layout 'application', :except => :view
Comments
Post a Comment