| View previous topic :: View next topic |
| Author |
Message |
juli
Joined: 07 Oct 2008 Posts: 22
|
Posted: Wed Oct 15, 2008 11:17 am Post subject: html.erb %-> syntax? |
|
|
Hi all,
In the rails api documentation I found,
<% form_tag '/posts' do -%>
<div><%= submit_tag 'Save' %></div>
<% end -%>
and tested this code successfully. What is the <% -%> syntax? Can someone explain this to me?
Are there comprehensive references for what's new in rails 2.0 and the differences between .rhtml and .html.erb files?
Thanks in advance. |
|
| Back to top |
|
 |
mvsr
Joined: 07 Oct 2008 Posts: 22
|
Posted: Wed Oct 15, 2008 11:19 am Post subject: html.erb %-> syntax? |
|
|
The extra dash means that ERb will remove any newlines succeeding that tag.
Regarding template names, take a look at this: http://stuff.lilleaas.net/how_rails_sel … _to_render . Do inform me if the article didn't answer your question! |
|
| Back to top |
|
 |
|