ActionController <-> ActiveView code access ambiguity

Hi All!
This is not a problem in general but i’ve just missed the point.
If my application has a global state, which i have to use both
throughout ActionController and ActiveView, then, where to place that
state?
E.g. if I do this:

class ApplicationController < ActionController::Base
protected
def authenticated?
!user.nil?
end
end

then I can’t use that from any View. And, on the other hand, if I do
write that as a public method - it acts as an action…

So, where to place such “global” properties?

Thanx a lot!

Anyone?

On Fri, Mar 14, 2008 at 1:27 PM, sinm [email protected] wrote:

def authenticated?
!user.nil?
end
end

then I can’t use that from any View. And, on the other hand, if I do
write that as a public method - it acts as an action…

So, where to place such “global” properties?

Thanx a lot!

http://rails.rubyonrails.org/classes/ActionController/Helpers/ClassMethods.html#M000284

class FooController
helper_method :authenticated?
end


Rick O.
http://lighthouseapp.com
http://weblog.techno-weenie.net
http://mephistoblog.com

Oh. Thanks. I’ll give it a try.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs