hello, I am writing a js/coffee file that gets erb handling and I need to use a url helper inside this file if write .. url: ''<%= url_for(:action => :index) %>'' I get an error: NoMethodError Exception: undefined method `url_for'' for #<#<Class: 0xbdbb068>:0xeed1eb8>>>self.class#<Class:0xbdbb068> < Sprockets::Context How do I make url_for accessible in Sprockets::Context? 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-/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.
Peter De Berdt
2011-Nov-10 08:27 UTC
Re: url helper in model.js.erb.cofee (Sprockets::Context)
On 10 Nov 2011, at 06:04, slava wrote:> I am writing a js/coffee file that gets erb handling and I need to use > a url helper inside this file > if write > .. > url: ''<%= url_for(:action => :index) %>'' > > I get an error: > NoMethodError Exception: undefined method `url_for'' for #<#<Class: > 0xbdbb068>:0xeed1eb8> > >>> self.class > #<Class:0xbdbb068> < Sprockets::Context > > How do I make url_for accessible in Sprockets::Context?http://stackoverflow.com/questions/7517140/why-are-the-actionviewhelpersurlhelper-not-available-in-the-assets-pipeline Best regards Peter De Berdt -- 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.
Seemingly Similar Threads
- cache-busting non-digest assets in sprockets in development a good idea? should headers in sprockets be configurable?
- Sprockets, JST, Eco and escaping
- Problem with rails generaterspec:install, Error-Message: no such file to load, sprockets-railtie (loadError)
- Error : bundle install
- Sprockets File not Found Exception.