Friday, 13 September 2013

Rails how to convert user input to normal "#{user.id}"

Rails how to convert user input to normal "#{user.id}"

I created an little app for me, where i can send birthday cards to
diffrent persons.
In my settings model i have two fields salutation and text.
So when i create an new card i would like to write into the salutation form:
"Happy Birthday, Mr.#{@friend.name}"
My problem is that when i want to print my salutation the #{@friend.name}
gets not evaluated.
I tried diffrent things to solve this problem eg:
puts salutation.to_s
puts "#{salutation}"
But it didnt worked! I hope somebody can help me with this! Thanks

No comments:

Post a Comment