Thank you very much, I checked the link with FF and see all the information you're talking about (for some reason IE wouldn't display the tags). I will try this right now!
On 20 oct, 02:30, Michael Pavling <[email protected]> wrote: > On 19 October 2010 23:22, CiriusMex <[email protected]> wrote: > > > Ok, I checked the doc but I don't fully understand: > > - First what is the "-" you was talking about? I can't see any > > reference to this > > The first line about ERb says "You trigger ERb by using embeddings > such as <% %>, <% -%>, and <%= %>" > > > - Second about this: > > "If you absolutely must write from within a function use concat. > > suppress leading and trailing whitespace, including the trailing > > newline, and can be used interchangeably with ." > > So you did see it - the "suppress leading and trailing whitespace" > line that you quote part of (which probably due to HTML emails has > gotten fubared) is talking about <%- and -%>. > > > Does it means I have to use functions to display my contents? I don't > > get it... > > No. It says "if" - some people insist on doing smelly things - like > rendering output while they're in functions - and *if* someone insists > on doing that, it's better to use "concat" than to use ERb tags. But > it's better yet to *not* output from functions at > all.http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html... > > If you have a partial that does this: > <% if true %> > The outcome of the statement is <%= "true" %> > <% end %> > > ...if you look in the source, you'll see some extra whitespace. If you > care about getting rid of it at all (for the most part, I don't), you > could do this instead: > > <%- if true -%> > The outcome of the statement is <%= "true" -%> > <%- end -%> > > ... or someone who spends more time fiddling with the rendering of > Rails apps than I do will probably tell you that an *even better* > solution is to use something like HAML. All these options are choices > for you (since you were raising the issue of white-space) - nothing is > set in stone. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

