I have ran into the same concern and fundamentally feel like it is a
duplication of effort - even though the two actions perform different
purposes I want them to share 100% of the look-and-feel. I find myself
copying and pasting the appropriate show and edit files every time and
then going through and changing them as necessary for the designated
When I want to change the look-and-feel of one, I have to change the
other as well. I understand Toby’s argument, but it doesn’t change the
fact that it is duplicating the effort.
It would be nice if rails had a native way to set all the readonly
attributes (or enabled, etc… as appropriate for the control) to true
or false based on the view being a show or edit. This would eliminate
the duplication we see between the actions.
Just my opinion!
Toby B. firstname.lastname@example.org wrote:
If none of your fields in your ‘show’ action are editable, why do you
want to use a form?
Assuming you want a form (in a table) for editing and a table for
showing, it isn’t redundant (or in violation of the DRY rule) to have
separate partials or views. The two are inherently different.