Undocumented syntax?

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 -%>

<%= submit_tag ‘Save’ %>

<% 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.

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 -%>

<%= submit_tag ‘Save’ %>

<% 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

For more ERB tags, check out:
http://stdlib.rubyonrails.org/libdoc/erb/rdoc/classes/ERB.html

On Feb 9, 2008 2:54 PM, Greg W. [email protected] wrote:

In particular, I refer to the closing Ruby delimiter ‘-%>’ syntax that


EPA Rating: 3000 Lines of Code / Gallon (of coffee)