Hi people,
The new "edit" page for scaffoldings is
something like:
<?r if all ?>
Show all?
show form
<?r else ?>
show errors
show form{
"Attributes for Foo"
f.attributes
"Relations for foo"
f.relations
}
<? end ?>
I've made an helper out of the "show errors"
part, so the view code is
cleaner, and this is a functionality that could be useful to
others.
* This patch refactors the code used in the scaffolded
view to be
usable as a simple helper method (part of FormHelper).
It basically creates a div containing a <ul> list
of <li> tags, each
containing a string "name: message" for the
errors in flash[:ERRORS]
Tests attached.
Also, why is the form view different on the two sides of the
else?
We could possibly use the same code in both and push the new
functionality, i.e. highlight of what the field mean, into
form_for.
Possibly with an option ( :field_headers=>true or
something).
What do others think?
--
blog en: http://www.riffraff.info
blog it: http://riffraff.blogsome
.com
jabber : rff.rff at gmail dot com
_______________________________________________
Nitro-general mailing list
Nitro-general rubyforge.org
h
ttp://rubyforge.org/mailman/listinfo/nitro-general |