问题
Am I correct with the idea below regarding ERB template? any advice would be really appreciated.
Is the embedded ruby syntax with an equal sign "<%= %>" intended to render some output? while the one without the equal sign "<% %>" doesn't.
回答1:
When you use <%= %>
you render the expression value to your output. While <% %>
is simply to write some Ruby code that won't be rendered to final output.
来源:https://stackoverflow.com/questions/8110997/embedded-ruby-syntax-in-rails