I’m making a Tweet This link in Rails. The URL I need to generate looks something like this:
http://twitter.com/share?url=http%3A%2F%2Fexample.com&text=Hello%20World
but a bit more complex. Basically a URL with a load of GET parameters appended
It would be nice to use one of Rails’ helpers, to generate this link, something like:
url_for("http://twitter.com/share", :url => "http://example.com", :text => "Hello world")
But I haven’t found anything that works. Anyone have any ideas?
You can call
to_queryon Hash in rails which will take care of url encoding etc. So maybe something like this: