Helper methods not availlable in controller

Hi,

I don’t start pasting lots of code since I am not sure what would be
relevant.

I have one controller that doesn’t include all my helper methods.
I get: undefined method `full_admin?’ for #<CompaniesController:
0x20ce458>
full_admin? is defined in my users_helper
def full_admin?
current_user.full_admin?
end

I do have
helper :all # include all helpers, all the time
in my application.rb controller.

So I would expect it to be availlable in all my controllers.

I know a helper method might not be the proper place for this but I
liked the syntactic suger for my controllers and views :wink:

What am I doing wrong?

Regards,
Wijnand

On Sep 14, 11:55 pm, Wijnand W. [email protected] wrote:

So I would expect it to be availlable in all my controllers.

I know a helper method might not be the proper place for this but I
liked the syntactic suger for my controllers and views :wink:

Helper means view helper: they are only included in views. If you want
a method you can call from views or controllers you need to define it
in your controller (if you need all controllers to see it then in
ApplicationController) and use helper_method to make it accessible to
views.

Fred

Helper means view helper: they are only included in views. If you want
a method you can call from views or controllers you need to define it
in your controller (if you need all controllers to see it then in
ApplicationController) and use helper_method to make it accessible to
views.

Fred

Okay, so how would you allow a controller (or even a model) to use for
instance the helpers truncate or sanitize?

Okay, so how would you allow a controller (or even a model) to use for
instance the helpers truncate or sanitize?

The solution I have found was to use xss_terminate plugin (compatible
with Rails 2.2.2), it also allows to dive into its code and see how it
is coded.