Change layout inside of action

How can I change the layout in the action method?

def show

if(params[:id] > 0)
layout :layout1
layout :default


Is this possible?

Have a look at this guide:

Please check to see if your questions are answered in the guides before
posting here.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs