On 18 February 2016 at 06:16, <ajayg1567@gmail.com> 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
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtB9w4yS-VtUpY2e5PngAq4qF6c68JefdjAcsUB080E%2BA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment