Ruby on Rails Thursday, May 30, 2013

Jim ruther Nill wrote in post #1110649:
> i think you can also use app for the url_helpers
>
> app.posts_path for example

Oh, yes, this works, they both work. Thank you, that's what I was
looking for.

irb(main):005:0> app.posts_path
=> "/posts"
irb(main):006:0> Rails.application.routes.url_helpers
=> #<Module:0x2d854b8>
irb(main):007:0> Rails.application.routes.url_helpers.posts_path
=> "/posts"

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/936dde3274442e37251c9381a027fd8c%40ruby-forum.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment