How can I use ' in Ruby? -
i cannot utilize '
within ''
this gets syntax error:( assuming @post.user.nickname john
@message = @post.user.nickname + ''s post'
it has john's post
how can utilize '
?
try
@message = @post.user.nickname + "'s post"
or
@message = @post.user.nickname + '\'s post'
ruby-on-rails ruby-on-rails-3
No comments:
Post a Comment