I have to add two buttons in edit page. I have default scaffold generated. I have tried to add a button in the _form.html.erb file in this way: <%= f.submit ‘accept’%> and <%= f.submit ‘reject’%> but because this form is rendered in new.html.erb so the buttons are also appearing in new page. I want these buttons only in edit page. I am new to ruby and rails. can any one please help. thnks
Share
Just copy the contents of _form.html.erb to both the edit and new files. Replacing the template call to _form. Then edit the contents of each file separately to suit your needs. After you copy the contents of _form over to the new and edit view files you can delete the _form file.