In my current rails application , there are multiple tabs for the edit
action. All tabs go to the same action. For example if i modify some
input
field in one tab , all the tabs parameters go to edit action.I need to
send
only those modified. Is there any suggestion for this scenario
On 18 February 2016 at 06:16, [email protected] wrote:
In my current rails application , there are multiple tabs for the edit
action. All tabs go to the same action. For example if i modify some input
field in one tab , all the tabs parameters go to edit action.I need to send
only those modified. Is there any suggestion for this scenario
Can you be a bit more explicit in what you are looking for? Is the
user allowed to enter data on multiple tabs and then submit it? If so
then I don’t see how it would be possible to have different actions.
If there is a button on each tab then you can send each button to a
different action, but then what happens if he changes data on one tab
and then switches tabs.
If all you are worried about is that the edit action is becoming too
long then just refactor it and call private methods of the controller
to do the sub-actions dependant on what data has changed or even
better, wherever possible, move logic into the model. Every time you
write some code in a controller you should think whether it would be
better to handle it in the model.
Colin