The problem was in my controller. I declared multiple instances of the layout this way:
class UsersController < ApplicationController layout "intro", only: [:new, :create] layout "full_page", only: [:show] ... end
Do not do this! The second ad will take precedence, and you will not get the desired effect.
Instead, if your layouts are just action specific, simply declare them in the action as follows:
def show ... render layout: "full_page" end
Or, if it's a little more complicated, you can use a character to defer processing to a method at runtime as follows:
class UsersController < ApplicationController layout :determine_layout ... private def determine_layout @current_user.admin? ? "admin" : "normal" end end
pruett
source share