Thursday 15 January 2015

ruby on rails - String interpolation in HTML attributes in an ERB file -


I have a feature that looks like this:

  data-text = " I won by ### playing ... "  

Where should ### be in my credit rating.

How do I apply it

  data-url = <% = request.scheme%> & gt;  

I'm trying:

+ "//" + <% = request.port%>

In this situation I do not know how the whole plan should be around the port.

Thanks

  data-text = "I play ## Credits} won ... "  

You can apply the same principle to other strings, such as:

  data-url =" # {request. Scheme} // # {request.port} "   

No comments:

Post a Comment