I have the following line containing a regex using RoR in a view (show.html.haml):
- unless @article.content =~ /find(#{image.id})/
The problem is that the regex is not evaluated since it’s interpreted as a comment. How can I escape the comment?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
or
Edit: I guess I did not really answer the question. To escape the comment, take a look at cyle‘s answer that suggests using the
\character.