Reputation: 59039
I develop it in Ruby on Rails 2.0.5 now.
Can I execute link_to method and the url_escape method use in /script/console?
Upvotes: 0
Views: 623
Reputation: 28703
It's quite easy to use url_encode
(I assume that's what you mean):
>> ERB::Util.erb_encode("hello world")
=> "hello%20world"
For helpers in ActionView, you can do:
>> helper.link_to "you", "some_url"
=> "<a href=\"some_url\">you</a>"
Upvotes: 2