Reputation: 51
I started creating a web service in Ruby on Rails. After some time I discovered some amazing javascript frameworks:
Does that JS frameworks saves user informations in database (Model?) and are they good solution for creating web application intended to users?
Upvotes: 1
Views: 288
Reputation: 4539
The short answer is yes, JS frameworks save data in models.
JS frameworks are good solutions if:
There is a lot of hype over js frameworks and tools, so in general it is a good idea to learn them - although the undertaking is not trivial.
To answer your question, well first you need Ruby alongside JS to produce meaningful apps. That said, backbone.js and others will save the data to the model, by means of passing the json object to the RoR resource, that in turn saves the data to the backend (SQL or noSQL). So, your JS models will save the data, and you also need RoR models for this to work (which can be simple and only, e.g., expose database as http(s) resources).
Upvotes: 2
Reputation: 1068
The frameworks you mentioned, usually keep representations of your data in the memory as models. In order to have the data saved in the database will have to manage communication between the framework and the models on your server. Backbone uses RESTfull http requests. If you want you can rewrite Backbone.sync in order to adjust the sync to the models manages by your server.
They are very good solutions for creating web applications, however for small projects they might be overkill. While there are differences among the frameworks you mentioned (e.g. SproutCore, -which is now called emberjs, forces you to adhere to their style a lot, Backbone lets you decide more), what they really do is help you structure your javascript project.
Upvotes: 3
Reputation: 2685
They are purely client-side frameworks. This means they only display data to the user, and be manipulated within the browser. No changes whatsoever are automatically pushed to the database. It is up to you to create some sort of save button which will POST the data back to your server where it is handled, validated and saved in any database you want
Upvotes: 2