Here I’ve a controller with 4 actions and i wanna apply application layout ( the default layout ) to new action only , or in other words i wanna except only index action from the layout so i write this but it doesn’t work, the index template is rendering with the layout.
class SessionsController < ApplicationController
layout 'application', :except => :index
def index
end
def new
end
def create
end
end
def destroy
end
end
also I tried
layout 'application', :only => :new
but it doesn’t work too, same problem which the index template is rendering with layout.
any suggestions what’s the problem here?
You can create a method to define your layout and fix your layout only on new action