Displaying 1 result from an estimated 1 matches for "div_with_errors_for".
2007 Dec 09
0
Writing Specifications for Custom Form Builders (and Helpers)
...a what on earth I am doing) to Ruby,
Rails and Rspec and have a feeling I am probably trying to run before
I know how to walk.
I had imagined a cool way of outputting a div around some form stuff
which would have a class on it if the related field had errors,
something a bit like:
<% f.div_with_errors_for :login do %>
<label for="user_login">Login Name:</label>
<%= f.text_field :login %>
<% end %>
It will output a regular div if there are no errors on the field or
<div class="error">... if there is an error.
So, I began trying to get this wo...