I came across this in api.rubyonrails.org and am wondering if it is a typo or an undocumented feature. Can someone explain? <% form_tag ''/posts'' do -%> <div><%= submit_tag ''Save'' %></div> <% end -%> In particular, I refer to the closing Ruby delimiter ''-%>'' syntax that is repeated twice in this example. Pardon me if this is obvious. I am still new to Ruby. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Feb 9, 2008, at 2:34 PM, rogwei wrote:> I came across this in api.rubyonrails.org and am wondering if it is a > typo or an undocumented feature. Can someone explain? > > <% form_tag ''/posts'' do -%> > <div><%= submit_tag ''Save'' %></div> > <% end -%> > > In particular, I refer to the closing Ruby delimiter ''-%>'' syntax that > is repeated twice in this example.the - supresses white space output for that ERB line -- def gw acts_as_n00b writes_at ''www.railsdev.ws'' end --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
For more ERB tags, check out: http://stdlib.rubyonrails.org/libdoc/erb/rdoc/classes/ERB.html On Feb 9, 2008 2:54 PM, Greg Willits <lists-0Bv1hcaDFPRk211Z5VL+QA@public.gmane.org> wrote:> > On Feb 9, 2008, at 2:34 PM, rogwei wrote: > > > I came across this in api.rubyonrails.org and am wondering if it is a > > typo or an undocumented feature. Can someone explain? > > > > <% form_tag ''/posts'' do -%> > > <div><%= submit_tag ''Save'' %></div> > > <% end -%> > > > > In particular, I refer to the closing Ruby delimiter ''-%>'' syntax that > > is repeated twice in this example. > > > the - supresses white space output for that ERB line > > -- > def gw > acts_as_n00b > writes_at ''www.railsdev.ws'' > end > > > > > > > >-- EPA Rating: 3000 Lines of Code / Gallon (of coffee) --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---