Vixiom Axioms

January 18, 2008

Rails: cleaner partials in forms

Filed under: Ruby, Ruby on Rails Alastair @ 11:04 am

Damian pointed me to the patch ELC Technologies committed to Rails.

As he mentions previously you did something like

<% form_for(@client) do |f| %>
    <%= render :partial => form, :locals => {:f => f} %>
    <%= submit_tag Create %>
<% end %>

but now you can just do…

<% form_for(@client) do |f| %>
    <%= render :partial => f %>
    <%= submit_tag Create %>
<% end %>

Cleaner and more intuitive, nice!

Digg! submit Rails: cleaner partials in forms to stumbleupon.com submit Rails: cleaner partials in forms to del.icio.us submit Rails: cleaner partials in forms to reddit.com Like this post? subscribe to the feed.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-Spam Image

Powered by WordPress