If you use form_for , you can use the same template for new and edit .
form_for will check if an object is being saved. If this is a new entry, the action url will point to #update , if it persists, it will point to #create .
So yes, your comment will work when using the same template for βnewβ and βeditingβ. When is obj.new_record? , this is an editing form.
source share