Answer the question
In order to leave comments, you need to log in
Is it possible to make a completely AJAX application on Rails
And will there be any sense in using it (Rails), in particular, will it be possible to use favorite gems, which are often not designed for dynamics. In addition, routing and structure should also be radically different. Or with several controllers that will combine many models.
Maybe someone wrote something similar. I don’t think Twitter can be taken as an example, there is probably little left of the rails.
Answer the question
In order to leave comments, you need to log in
And how should it be fundamentally different?
respond_to |format| do
format.html{} #без AJAX template.html.erb
format.js{} #AJAX template.js.erb
end
Look towards Backbone.js BTW + a book about how to make friends with it and rails - Backbone.js on Rails , you can also see its contents and a couple of pages from the book. (Access to the book, by the way, is interestingly organized - after the purchase, the Thoughtbot organization is added to the group of readers of this book on github, the source code of the book + HTML/PDF/ePub/mobi is in a private repository available to members of this group)
In my opinion, it’s even easier to make it than non-Ajax, when really one controller method should pull out a bunch of models for templates and layouts (if you stick to true MVC and don’t call other controllers in templates, let alone models) - you don’t need a bunch of heterogeneous pull out models with one http request, for one model (or for one collection of homogeneous models) - one request. There will be some overhead, of course, but there will be a clear and understandable code, both on the client and on the server (and on the server it’s also primitive, it can only be complicated in the model).
AJAX is closely related to REST. There is nothing easier than writing normal REST applications on Rails (map resources). github.com/steffen/extjswithrails.restful.sample/
By the way, there are also a bunch of simplifiers - netzke.org/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question