Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 如何使用';用红宝石?_Ruby On Rails_Ruby On Rails 3 - Fatal编程技术网

Ruby on rails 如何使用';用红宝石?

Ruby on rails 如何使用';用红宝石?,ruby-on-rails,ruby-on-rails-3,Ruby On Rails,Ruby On Rails 3,我不能在'中使用' 这将获取语法错误:( 假设@post.user.昵称是John @message = @post.user.nickname + ''s post' 必须是约翰的帖子 如何使用”?试试看 @message = @post.user.nickname + "'s post" 或 @message = @post.user.nickname + '\'s post'

我不能在
'
中使用
'

这将获取语法错误:( 假设@post.user.昵称是
John

@message = @post.user.nickname + ''s post'
必须是约翰的帖子

如何使用

试试看

@message = @post.user.nickname + "'s post"

@message = @post.user.nickname + '\'s post'