You can then use the following in your controller's new and edit methods to make them both use the form.html.haml template instead of their respective defaults:
render :template => 'controller/form'Before rails 2.0 this would not have been a very elegant thing to do, but with the new form_for method, it assumes a restful implementation and will therefore submit to the appropriate create or update action. So without any extra code you can elegantly have just one form for both new and edit.
0 comments:
Post a Comment