views:

131

answers:

1

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?

+2  A: 

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>"
Yehuda Katz