Forum: Ruby on Rails newbie: %Q method?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D69d23d8e811e8ab2a8593380d6ede63?d=identicon&s=25 Jeff Emminger (jemminger)
on 2007-03-27 19:07
(Received via mailing list)
the tutorial at
http://www.onlamp.com/pub/a/onlamp/2007/01/05/revi...

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

what is this %Q method?
D69d23d8e811e8ab2a8593380d6ede63?d=identicon&s=25 Jeff Emminger (jemminger)
on 2007-03-27 19:25
(Received via mailing list)
nevermind... kept googling and found it:
http://www.rubycentral.com/book/language.html#UB
2f9a03aa0fcfe945229cb6126eda2cb2?d=identicon&s=25 Philip Hallstrom (Guest)
on 2007-03-27 19:28
(Received via mailing list)
> the tutorial at
> 
http://www.onlamp.com/pub/a/onlamp/2007/01/05/revi...
>
> 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"
This topic is locked and can not be replied to.