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

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -