Newbie: %Q method?


#1

the tutorial at
http://www.onlamp.com/pub/a/onlamp/2007/01/05/revisiting-ruby-on-rails-revisited-2.html?page=3

uses this code:
<%= link_to %Q{#{category.send(column.name)}}, :action => ‘show’, :id
=> category %>

what is this %Q method?


#2

nevermind… kept googling and found it:
http://www.rubycentral.com/book/language.html#UB


#3

the tutorial at
http://www.onlamp.com/pub/a/onlamp/2007/01/05/revisiting-ruby-on-rails-revisited-2.html?page=3

uses this code:
<%= link_to %Q{#{category.send(column.name)}}, :action => ‘show’, :id
=> category %>

what is this %Q method?

It’s the same as using double quotes… but sometimes makes things
nicer… say when you want to embed a lot of double quotes in your
string
and not worry about escaping them.

irb(main):003:0> %Q{one “two” three}
=> “one “two” three”