Using a helper_method in a view

I’m having an odd problem… in application.rb I have:

helper_method :admin?

…since I use this all the time in my views to test if the user is an
administrator, of course. Pretty standard.

I thought I’d be able to use this in specific helpers, but I’m getting
“method not found”:

undefined method `admin?’

I’m surprised the admin? method works in a view but not in the
respective helper. Anything I’m missing? How can I use this method in
helpers?

Thanks!

Oops… subject should be “using a helper_method in a helper”.

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