Reputation: 1326
I have bean seen code of scaffold in rails. I found
<%% breadcrumb_add "<%= plural_table_name.capitalize %>", <%= plural_table_name %>_path %>
<%%= render 'form' %>
What is <%%
and how to use?
Upvotes: 3
Views: 148
Reputation: 79813
<%%
in Erb produces a literal <%
in the output. You can use it if you want the output of your template to also be Erb, which is what is happening in the Rails example you link to.
In your code, the output will be something like (if the variable plural_table_name
is things
):
<% breadcrumb_add "Things", thing_path %>
<%= render 'form' %>
which itself is Erb.
Upvotes: 1