I came had this error and found it was being caused by trying to add a
symbol to a string.

ruby-1.9.2-p180 > a string"+:a_symbol #=> TypeError: can't convert
Symbol into String

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • Sathia S at Nov 22, 2011 at 9:27 am
    Hi

    ruby-1.9.2-p180 > a string"+:a_symbol #=> TypeError: can't convert
    Symbol into String

    You cannot concat string to symbol directly.
    convert symbol to string and then concat it.

    "string"+:sym.to_s

    *to_s *is used to convert to string

    ------------------------------------------------------------------------------------------
    Regards
    sathia

    Here I share my experience in open source.
    http://www.sathia27.wordpress.com
    <http://www.sathia27.wordpress.com/>http://www.lquery.com<http://www.sathia27.wordpress.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 rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedNov 21, '11 at 2:03p
activeNov 22, '11 at 9:27a
posts2
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Nat Noordanus: 1 post Sathia S: 1 post

People

Translate

site design / logo © 2022 Grokbase