Reputation: 1137
I have been playing with Emberjs for week or so now, I intend to create an application using RoR and Emberjs in the process of learning Emberjs. I was wondering the following in which I hope you can share you experience with me.
When you say that Ember can provide single page app, does that mean we are not using rails views any more? what is the connection between both of the views? I am confused about this issue so far.
Having Rails as the JSON API, does that mean we neglected other powerful features like haml processing and other views based technologies?
For Model validations, is Ember models are different from Rails Models, how can we integrate both?
I hope this can be the seed for a discussion to help other people who want to know more about Ember and Rails.
if you know applications who manged to do Ember/Rails integration, I will be more than happy to study what they have done and share the experience
Upvotes: 1
Views: 105
Reputation: 19050
When you say that Ember can provide single page app, does that mean we are not using rails views any more? what is the connection between both of the views? I am confused about this issue so far.
Yes that is what it means. Our ember app has one rails view but it's nothing but a head/body tag.
Having Rails as the JSON API, does that mean we neglected other powerful features like haml processing and other views based technologies?
Yes but you don't get points for using the most technologies. Tech like HAML is designed for writing a rails-style MVC app. Handlebars is a better choice for an ember app.
For Model validations, is Ember models are different from Rails Models, how can we integrate both?
They are different and that is a good thing. In a simple app there is often a 1-1 relationship between ember and rails models, like you might have a Post model in both ember and rails. Your rails app will serve Post via a JSON API, and the ember app will use that API. The ember-rails gem makes it easy to generate rails and ember models quickly.
You can find a good guide to using ember with rails here: http://www.devmynd.com/blog/2013-3-rails-ember-js
Upvotes: 1