|
|
|
|
|
by vidarh
4961 days ago
|
|
ERB (one of a ton of view engines you plug into rails): <% Model.friends.each do |person| %>
<p><%=person.name %></p>
<% end %>
Or: <% for person in Model.friends %>
<p><%=person.name %></p>
<% end %>
I don't even like Rails, but I fail to see how that is "really smelly". Or as I prefer Mustache, I'd probably rather pass Model.friends to the view as a variable and do: {{#friends}}
<p>{{name}}</p>
{{/friends}}
But regardless what engine you do, you'd be hard pressed to find any big differences in terms of iterating over a collection. I find it very hard to believe that you're a Rails developer yet somehow find the above syntax so much more elegant that you'll use that as an example of how rails has a "really smelly" view engine. |
|
How can you compare that, to a simple `@` symbol? ERB (or even Mustache for that matter, feel like a relic compares to Razor.