1. At the Controller level
class PostsController < ApplicationController
layout "index_layout" only [:index]
layout "nomal_layout" expect [:index]
end
2. At the action level
class PostsController < ApplicationController
if @post.save?
render layout: "success_layout"
else
render :new, layout: false
end
end
Top comments (0)