This might be a simple question to answer, but I couldn't find the answer.
In Ruby on Rails, I thought the helper function would help escape special characters.
Example: " She's the one that took me "to" "
Code wise: <%= h("She's the one that took me "to" ") %>
However, the double quote won't allow me to display the code on the browser and gives me an error.
I thought the h() is an alias for html_escape() and they convert the following 4 characters
 <   >    &    "
into
<   >  &开发者_如何转开发amp;amp;  "
Is there something i'm missing with using double quotes?
Any advice is appreciated Thanks, D
The problem is that your double quote around the word to is closing the double quote opened at the beginning of the string. Try this:
<%= h("She's the one that took me \"to\" ") %>
Or, to avoid having to backslashify the internal double quotes, you could use the % syntax for creating the string:
<%= h(%[She's the one that took me "to" ]) %>
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论