Should rails ajax calls be bundled into their own separate controller? -
Should have AJAX calls that are not refreshing:
- Put in the controller which is mostly Your performance / view, or
- Consolidate in your own separate 'Ajax' controller?
I am doing 1, but I have read it (2725 diggs) article
(see 9 point)
and this method opts for the method. But he is a PHP developer though.
One benefit can be that it can clean the paths from 2
It seems that one's 6.5, the second half baker's dozen type a matter of. / P>
Which options do you go for?
I like the first approach:
- This is analogous If the resource XXX is included in an Ajax action, you (and other coders) will know where the things in your application reveal, thanks to the rail conferences.
- If your application is heavy on Ajax (and nowadays most of them), then you will end up with a BHAM AjaxController which completely slows down your rest controller just the highly humiliated non Javascript CRUD functions Will be available to provide. Similarly, testing your Ajax Controller can be a bit confusing because you have to set scenario-load fixtures, socks, etc. for each "agedified" resource of your app.
Comments
Post a Comment