When I want to show output, "<%= %>" When I do not want to show output, "<%- %>" or "<% %>" What about this? "<% -%>" Is this same as "<%- %>"? -duke -- Posted via http://www.ruby-forum.com/.
the hyphens suppress newlines. i''m not sure if the single versions are equal, but i double them up just out of habit: <%- ... -%> -eric On Oct 21, 12:21 pm, Duke Yamamoto <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> When I want to show output, > "<%= %>" > When I do not want to show output, > "<%- %>" or "<% %>" > What about this? > "<% -%>" > Is this same as "<%- %>"? > > -duke > -- > Posted viahttp://www.ruby-forum.com/.
Duke Yamamoto wrote:> When I want to show output, > "<%= %>" > When I do not want to show output, > "<%- %>" or "<% %>" > What about this? > "<% -%>" > Is this same as "<%- %>"?<%# %> or <%# -%> For commenting out ERB code. -- Posted via http://www.ruby-forum.com/.
Robert Walker wrote:> Duke Yamamoto wrote: >> When I want to show output, >> "<%= %>" >> When I do not want to show output, >> "<%- %>" or "<% %>" >> What about this? >> "<% -%>" >> Is this same as "<%- %>"? > > <%# %> or <%# -%> > For commenting out ERB code.I''m seeing code, <% if flash[:error] -%> <%= flash[:error] %> <% end -%> It works fine. -- Posted via http://www.ruby-forum.com/.