我希望我的欢迎控制器使用不同的布局:
class WelcomeController < ApplicationController
def index
if signed_in?
layout 'default'
else
layout 'welcome'
end
render 'welcome/index'
end
end
答案 0 :(得分:4)
class WelcomeController < ApplicationController
def index
if signed_in?
render :layout => 'default'
else
render :layout => 'welcome'
end
end
end