Interpolation within single quotes

牧云@^-^@ 提交于 2019-11-29 03:42:42

You can use %{text contains "#{search.query}"} if you don't want to escape the double quotes "text contains \"#{search.query}\"".

Ahmed Eshaan
'Hi, %{professor}, You have been invited for %{booking_type}. You may accept, reject or keep discussing more about this offer' % {professor: 'Mr. Ashaan', booking_type: 'Dinner'}

Use

%q(text contains "#{search.query}") 

which means start the string with single quote. Or if you want to start with double quote use:

%Q(text contains '#{text}')
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!