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 ;-)
What am I doing wrong?
Regards,
Wijnand
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
On Sep 14, 11:55 pm, Wijnand Wiersma <wijn...-iLgb6HK7W+esTnJN9+BGXg@public.gmane.org> 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 ;-) >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> What am I doing wrong? > > Regards, > Wijnand--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 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 -~----------~----~----~----~------~----~------~--~---
> 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. > > FredOkay, so how would you allow a controller (or even a model) to use for instance the helpers truncate or sanitize? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> 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. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---