Hi there, I''m new to ruby and rails. I''m going through a few tutorials and I got the updated agile book. One thing I keep seeing which hasn''t quite been properly explained is something like this: puts "Hello #{name.capitalize}!" At one place it stated that the {} merely insert a string into a string - I assume like concatenation. However the # has not been explained. Do the # and {} go together? --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Yes, they do go together. It just callse to_s on the result of any ruby code between #{ and }. -Bill Pixelmech wrote:> Hi there, > > I''m new to ruby and rails. I''m going through a few tutorials and I got > the updated agile book. One thing I keep seeing which hasn''t quite > been properly explained is something like this: > > puts "Hello #{name.capitalize}!" > > At one place it stated that the {} merely insert a string into a > string - I assume like concatenation. However the # has not been > explained. Do the # and {} go together? > > > > >-- Sincerely, William Pratt --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
*calls not callse...hit send to fast :) William Pratt wrote:> Yes, they do go together. It just callse to_s on the result of any ruby > code between #{ and }. > > -Bill > > Pixelmech wrote: > >> Hi there, >> >> I''m new to ruby and rails. I''m going through a few tutorials and I got >> the updated agile book. One thing I keep seeing which hasn''t quite >> been properly explained is something like this: >> >> puts "Hello #{name.capitalize}!" >> >> At one place it stated that the {} merely insert a string into a >> string - I assume like concatenation. However the # has not been >> explained. Do the # and {} go together? >> >> >> >> >> > >-- Sincerely, William Pratt --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Nov 30, 1:02 pm, William Pratt <bi...-YbheRAKfYF4eIZ0/mPfg9Q@public.gmane.org> wrote:> Yes, they do go together. It just callse to_s on the result of any ruby > code between #{ and }.Ah, gotcha. Thank you! --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---