Ian White

Update: the following is really sucky, and you probably don't want to read it.

Found a moment to catch my breath, and thought I'd make a start at releasing our plugins into the wild (hopefully they'll come back fitter than before).

The first one is real small and simple. confirmation_field adds two form input helpers: confirmation_text_field and confirmation_password_field. So now you can do this:

<%= text_field :customer, :email %>
<%= confirmation_text_field :customer, :email %>

<%= password_field :customer, :pass %>
<%= confirmation_password_field :customer, :pass %>
or
<% form_for :customer, @customer do |f| %> 
   <%= f.text_field :email %>
   <%= f.confirmation_text_field :email %>
<% end %>

Why? Because when I'm presenting an edit view for an existing model, I want the confirmation field to match its pair by default. (How many forms have you filled in where you bone-headedly have to retype your email or password once for every other mistake you make?). You could make this change at the model level (by loading the virtual confirmation field attribute after find), but that's messy - this is a view issue, it should stay in the views.

You can get it from svn, and also browse the rdoc. Please email me with improvements etc.

1 Response to “Rails plugin: confirmation_field”

  1. Venkat Says:

    Hello Ian & Ray:

    Thanks for sharing your plugins with the world. It is a very good way to do it and seeing you practice it is inspiring.

    Looking forward to more posts on the rest of your plugins too.

    Take care,
    Venkat.

Leave a Reply