[Please quote when replying. It makes the discussion easier to follow.]
winter heat wrote:
let's assume class1, 2, and 3, etc all have their functions, so we need
all of them.
But do you need them nested, or can they be on the same element?
the 3rd code piece is what we want: class 3 should be nested inside of
class2, which is what this question is all about.
why is using "request.xhr?" inside of a view not a good idea?
Because the view shouldn't know anything about the nature of the
request. The view should only know what the controller tells it.
if so,
you should only use it in controller and why?
Because according to Rails MVC design principles, views should be as
dumb as possible. The request object is really none of the view's
business -- all the view should do is display the data the controller
passes it.