This is my new way of learning and promoting my intelligence in Ruby. My intention is to create a new Ruby tip everyday. These tips will come from all places and will certainly involve examples from work and frameworks.

Here is a cool way of creating a link in Rails:

"" + { language: "ruby", status: "awesome" }.to_query
# => ""

or without Rails require CGI

require 'cgi' # Only needed for IRB, Rails already has this loaded
CGI::parse "language=ruby&status=awesome"
# => {"language"=>["ruby"], "status"=>["awesome"]}

I learned this from:

Leave a Reply

Your email address will not be published. Required fields are marked *