Hi every one, I wrote a Utility class for my application, and i want to use "url_for", I included the url_helper but i get this error NoMethodError: undefined method `url_for'' for UtilityBatch:Class - i tried require ''action_view/helpers/url_helper.rb'' include ActionView::Helpers::UrlHelper ... with no result ... i was able to construct the urls as strings but i was wondering what do i need to do to use url_for in my class. All input is appreciated. Thank you. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
jimache wrote:> I wrote a Utility class for my application, and i want to use > "url_for", I included the url_helper but i get this error > > NoMethodError: undefined method `url_for'' for UtilityBatch:Class > > - i tried require ''action_view/helpers/url_helper.rb'' > include ActionView::Helpers::UrlHelper ... with no result > > ... i was able to construct the urls as strings but i was wondering > what do i need to do to use url_for in my class.Try using "extend" instead of "include" so as to make the url helpers class methods. -- We develop, watch us RoR, in numbers too big to ignore. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Did you find the solution? Am facing the same issue. Thanks, Pratik -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.