So, I'm trying to change the layout of the view based on url parameters.
So far, I realized that I need to install the layout in the controller. In my controller, under the action of the show, I have:
if params['iframe'] == 'true'
render :layout => 'vendored'
end
The 'vendored' layout exists in views / layouts. I get scary rendering several times. Here is the rest of the show action in my controller:
def show
@event = Event.find(params[:id])
@user = current_user
@approved_employers = current_user.get_employers_approving_event(@event) if user_signed_in?
respond_with(@event)
The problem is that I do not see another render. I do not see another in the entire controller. Of course, there is a render somewhere, because it displays my default application layout, is this the cause of the problem? I read in rail documents what I can add
and return
, , , , . redirect_to. ? ?