I have an embedded ruby layout file for a navbar. The innerHTML of the anchor tag holds an embedded ruby snippet calling the value of the string.
<% text_var = "check string" %>
<a id="show_string" class="brand" ><% text_var %></a>
RESULTS
- Blank title for anchor tag
- Rails did not throw an error page
If I have instead <a id="show_string" class="brand" >This is Plain Text</a>
then it displays "This is Plain Text" as the title of the anchor tag.
- Is there a conflict with the embedded ruby and the innerHTML?
- Syntax / Use of embedded ruby incorrect?
try
You need the = sign to display the string