I use Engine.
How to get access to url_helpers, such as <name>_path or _<name>_url, in
a separate class? In application it simple:
Rails.application.routes.url_helpers.<name>_path

But how to get access to url_helpers in Engine? When I use
Rails.application.routes.url_helpers.root_path, then I get '/', root of
Application. Other helpers for Engine aren't not defined. Also
Rails.my_engine.routes.url_helpers.root_path fails.

--
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@googlegroups.com.
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.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedMay 1, '12 at 10:57a
activeMay 1, '12 at 10:57a
posts1
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

Sergey Ezhov: 1 post

People

Translate

site design / logo © 2022 Grokbase