On 23 February 2011 15:26, John Merlino <[email protected]> wrote:
> Thanks for response, but I place this in application controller:
>
>  helper_method :current_user
>
>  private
>
>  def current_user
>    @current_user ||= session[:user_id] && User.find(session[:user_id])
>  end
>
>
> And now because all my contorllers inherit from it, I get undefined
> method current_user on all the pages, even though current user is
> clearly defined.

Clearly defined, but private.
Whip a "public" in front of it, or move the method above the private
declaration.

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to