On Sat, Feb 11, 2012 at 9:46 PM, Mauro wrote:

route.rb

match "/:layout" => "company@index"

in application_controller I have:

before_filter :authenticate_user!
rescue_from DeviseLdapAuthenticatable::LdapException do |exception|
render :text => exception, :status => 500
end
protect_from_forgery
before_filter :set_layout

layout :specify_layout

def specify_layout
if @current_layout == :intra
"intranet"
elsif @current_layout == :inter
"internet"
else
"application"
end
end

def set_layout
if params[:layout] == "intraOp"
session[:current_layout] = :intra
elsif params[:layout] == "interOp"
session[:current_layout] = :inter
else
session[:current_layout] = nil
end
@current_layout = session[:current_layout]
end
end

in another controller I have:

skip_filter :authenticate_user!, :only => [:index, :show] unless
@current_layout.nil?

unless condition seem does not work.
What I am missing?
Maybe it could be :unless => @current_layout.nil? instead of unless
@current_layout.nil?

--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 16 | next ›
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedFeb 11, '12 at 11:46p
activeFeb 13, '12 at 9:46a
posts16
users5
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2021 Grokbase