Reputation: 535
i have the t function witch return some text.
so on my erb file i have something like that:
<%= t 'content1' %>
<%= t 'content2' %>
and the html output is something like that:
"text of the content 1"
"text of the content 2"
I would like to output something like that:
"text of the content 1" "text of the content 2"
thanx
Upvotes: 0
Views: 202
Reputation: 1596
Erb is a little overrated compared to other template languages out there. But, the good thing is it allows you to control the output. As @DMG pointed out add a '-' to your tags but there is also another point I wanted to show.
<%- method(...) -%>
Will not show any lines on output. While this will create a blank line:
<% method(...) -%>
Just something to keep in mind if your writing templates for scripts, unit tests, rake task, or anything else outside of Rails/ActionView
Upvotes: 1
Reputation: 26979
ERB has an option in the closing tag whether to have a newline after it. Just add a dash:
<%= t 'content1' -%>
<%= t 'content2' %>
Upvotes: 1