Sweet render shortcut

Posted by pratik
on Monday, July 23

I didn’t really know about this shortcut until I came across this ticket

In edge rails, instead of :


<%= render :partial => 'task', :collection => @tasks %>

You can do :


<%= render :partial => @tasks %>
Comments

Leave a response

  1. jcJuly 24, 2007 @ 07:52 AM

    Very cool. However, I think the syntax could have been slightly better <%= render :collection => @tasks %>

  2. PratikJuly 24, 2007 @ 10:01 AM

    Agree. I’ll try to submit a patch for that if/once my render cleanup gets accepted :-)