Colin Law wrote in post #955799:
> On 20 October 2010 16:11, Marnen Laibow-Koser <[email protected]>
> wrote:
>> '.to_sym .
> Well, I never new that you could do that, one lives and learns (for
> the moment anyway).
>
> Thanks, Marnen.

You're welcome!  I think I first came across it when I was developing a 
Facebook app: FBML tags have the form fb:something (that is, they're in 
an XML namespace), and I didn't want to use a string for a content_tag 
tag name if I could help it.  Obviously, :fb:something doesn't work, but 
:'fb:something' does.

You can use a double-quoted string too, and get the expected 
substitution.  Nice way of generating :"#{symbols}" on the fly.

>
> Colin

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to