The functionality I want to achieve with this is to have different fields based on the action the user is currently on.
The generic scaffold bundles the form into a partial and renders it in the new and edit actions. In a typical signup case, one may not want to update the password everytime the profile is updated. One way I used to solve this in the past is to create separate forms for new and edit; including the password in new only. Obviously, most fields repeat themselves. Is there a way to keep the partial but omit (thereby not updating) some fields on the form per action?
Let me assume you are building the form for user model.So in controller you will have
In the form partial use
This will not render the field during edit/update.