Might want to look at the blog post I just wrote on building a small sample app. It's going to be a series and build upon that first post from week to week.
Agree with your opinion. I tried to integrate emberjs into my rails app many times, but pitfalls make me question this approch: ember-data is not ready, how to handle error when server validate not pass? Integrate rails authentication, using server render devise view, or make some in ember side? File upload? Twitter switch back to server render... All of these make things difficult. Ember is good, but now I decide stick to plain old rails, because it is sample, I don't have to fight framework. I think future is one framework for client and server. It has enough abstract that app developer only have to think app things.
AngularJS is easier (actually way easier to understand) but Emberjs pays off in the end (in my opinion). Took me two weeks to learn most of what i needed from it and create a web gallery/photo store app front end (to sell files and prints) that runs very smoothly even in most 2-3 year old android and apple devices.
That being said, i can assure you... it was painful and frustrating, ember-data still needs a LOT of work, documentation can be confusing and outdated in some cases... As the framework changed a lot on the last few months a lot of the things you can find on stackoverflow are outdated...
On the other hand, once i started grasping the concepts of it, it just started to make perfect sense and now i love it.
It is the user that create/read/update/delete the tenant, not the other way around, so he can have multiple tenants. And in theory, a user can exist without any tenant if you desire so. You just need to implement a role based authorization system in your app.
App wide super-admin can be implemented as a kind of super user that has access to all tenants, but it's better to have it's own class so you can also assign different roles to it.
For those of you daunted by all the multiple files, routing, etc., all just to get a simple app up and running, keep in mind that if you need to put something together for prototyping, or you're having trouble keeping all the different pieces in your brain, here's a simplified JSBin of this Railscast:
For what it's worth, Ember doesn't show its relative strength when putting together toy apps. Would be nice to see a much more complex example and some commentary on how the two frameworks scale differently.
My co-worker, Tony Coconate, just posted a blog for setting up an Ember.js + Rails API application from scratch. It's a fairly easy process to get this started and he also brings in the use of the Ember Chrome Inspector for debugging:
Maybe its just me, but I don't see Angular working this way. What I mean is, it doesn't seem to be the right technology to use to "add js" functionality. jQuery is great for that. But these javascript frameworks make so much more sense when you build something for the client side FIRST.
You want to write your app in angular/ember and THEN use Rails or Sinatra (or...) for persistance, validations, and logic the user doesn't have to or shouldn't see, it makes much more sense.
I also think, and of course this is just my experience, that you can utilize JQuery without a solid understanding of javascript. Angular and many of these frameworks make so much more sense once you gain a solid footing with the idiosyncrasies of javascript.
Discourse mentions that Angular's documentation is not that great, which is a fair point. However, ember's documentation helps in the short-term, but does it help in the long-term? And Angular has other documentation apart from its own website, such as Railcast itself.
I am personally still debating on which one to go with. Would you still go with Ember if documentation wasn't an issue?
I don't think the number of screencast matter in this case. I think ember was very clearly presented in this one. Can't wait to see persistence in the next.
By using these rich javascript frameworks you only lessen the requirement of ActionView from the rails stack, there is still tremendous use for the rest of the stack. Especially when view rendering is usually a substantial chunk of your entire response times...
Do you mind elaborating on which task you find Angular is better at than JQuery? I'm trying to figure out whether to use Angular or even Ember for some stuff, but I'm not sure how to integrate these into an app that's already built on rails. I find it much easier to use JQuery along with Handlebars for templating in such cases.
Just try both on a small app and see which one you like better. Ember may be a bit short on resources to learn at the moment, but I assume that soon this will going to change.
I've been using ElasticSearch it's going fine, but I'm wondering if it's possible make 'operations' I mean for example how can I get the average or plus two values etc. ?? I'm not sure if can I do this using Tire??
If does anyone knows any solution I really appreciate
This is RAILScasts. Playcasts might use the Play Framework and Nodecasts might use Node.js :smile:
... or having the coffeescript monitor a click, we have to go through this entirely different framework to accomplish a simple task ....
I think you are missing the point. Why will you use a framework just to handle clicks? This screen-cast demonstrates ember using a basic app. Anything too complex might get viewers confused. When building a fairly large application, Ember(and others) can come in really handy.
Exactly. It is not easy to start writing applications in some js framework while jQuery suits most use cases really well and it so easy to start with. But I found that Angular can solve some tasks in a way that easier to implement than jQuery equivalent. Most important, you don't have to setup full-stack application for Angular. Just include it and start using.
I just wanted to say thanks. Your tip just saved me after almost an hour of looking for a solution. I would guess that line has something to do with IPv6 address support.
hai, i have error from kaminari pagination. here is the problem:
undefined method `page' for...
controller
def index
@users = User.order("created_at").page(params[:page]).per(50)
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @users }
end
end
view:
<%= paginate @users %>
generate:
rails g kaminari:config
rails g kaminari:views default
I have put gem 'kaminari' in my gemfile.
please help me. thanks you.
I think that the thing that confuses me with all of these javascript frameworks is, why use Rails at this point? I understand the difference between client side and server side frameworks, but all of these seem to be really intrusive to the Rails framework. Instead of using the application controller and returning a JS on remote: true or having the coffeescript monitor a click, we have to go through this entirely different framework to accomplish a simple task. Does anyone else feel my pain?
Might want to look at the blog post I just wrote on building a small sample app. It's going to be a series and build upon that first post from week to week.
http://www.devmynd.com/blog/2013-3-rails-ember-js
Agree with your opinion. I tried to integrate emberjs into my rails app many times, but pitfalls make me question this approch: ember-data is not ready, how to handle error when server validate not pass? Integrate rails authentication, using server render devise view, or make some in ember side? File upload? Twitter switch back to server render... All of these make things difficult. Ember is good, but now I decide stick to plain old rails, because it is sample, I don't have to fight framework. I think future is one framework for client and server. It has enough abstract that app developer only have to think app things.
all the frameworks have pros/cons
but heres a pretty nice article on ember
AngularJS is easier (actually way easier to understand) but Emberjs pays off in the end (in my opinion). Took me two weeks to learn most of what i needed from it and create a web gallery/photo store app front end (to sell files and prints) that runs very smoothly even in most 2-3 year old android and apple devices.
That being said, i can assure you... it was painful and frustrating, ember-data still needs a LOT of work, documentation can be confusing and outdated in some cases... As the framework changed a lot on the last few months a lot of the things you can find on stackoverflow are outdated...
On the other hand, once i started grasping the concepts of it, it just started to make perfect sense and now i love it.
Just my 2 cents!
+1
It is the user that create/read/update/delete the tenant, not the other way around, so he can have multiple tenants. And in theory, a user can exist without any tenant if you desire so. You just need to implement a role based authorization system in your app.
App wide super-admin can be implemented as a kind of super user that has access to all tenants, but it's better to have it's own class so you can also assign different roles to it.
It looks like CarrierWave isn't passing the correct instance to the uploader in recreate_versions. I have opened a ticket here:
https://github.com/jnicklas/carrierwave/issues/1015
Until this is fixed, this method Ryan uses here is currently broken.
Haven't really used it yet. A few people I trust tell me it's pretty good.
Strictly aesthetically, I don't love they way they mix directives into HTML, but I suspect I could get over it.
For those of you daunted by all the multiple files, routing, etc., all just to get a simple app up and running, keep in mind that if you need to put something together for prototyping, or you're having trouble keeping all the different pieces in your brain, here's a simplified JSBin of this Railscast:
http://jsbin.com/ixupad/151/edit
And if you're curious how you could use a HAML/Slim-esque templating alternative instead of Handlebars:
http://jsbin.com/ixupad/152/edit
Does anyone know how to group similar activities and shows as one? at the same time that others activities shows normally, Just like these:
Jhon removed a post
Jhon updated Post 1
Jhon created 3 posts:
-Post 1
-Post 2
-Post 3
PD: Thanks for the gem, so useful!
For what it's worth, Ember doesn't show its relative strength when putting together toy apps. Would be nice to see a much more complex example and some commentary on how the two frameworks scale differently.
Great Railscast, Ryan (as always).
My co-worker, Tony Coconate, just posted a blog for setting up an Ember.js + Rails API application from scratch. It's a fairly easy process to get this started and he also brings in the use of the Ember Chrome Inspector for debugging:
http://www.devmynd.com/blog/2013-3-rails-ember-js
Maybe its just me, but I don't see Angular working this way. What I mean is, it doesn't seem to be the right technology to use to "add js" functionality. jQuery is great for that. But these javascript frameworks make so much more sense when you build something for the client side FIRST.
You want to write your app in angular/ember and THEN use Rails or Sinatra (or...) for persistance, validations, and logic the user doesn't have to or shouldn't see, it makes much more sense.
I also think, and of course this is just my experience, that you can utilize JQuery without a solid understanding of javascript. Angular and many of these frameworks make so much more sense once you gain a solid footing with the idiosyncrasies of javascript.
<%= controller.view_paths %> dont work. It shows me: #ActionView::PathSet:0x007fe6952365a8
What should I do?
+1
Hi Noel i was wondering what is your opinion about Angular, I really want to know your opinion, thank you
Discourse mentions that Angular's documentation is not that great, which is a fair point. However, ember's documentation helps in the short-term, but does it help in the long-term? And Angular has other documentation apart from its own website, such as Railcast itself.
I am personally still debating on which one to go with. Would you still go with Ember if documentation wasn't an issue?
+1 to sharing thoughts
What I'd like to see is mixing ember with some server side rendering...just to see how I could incorporate this into an existing application.
I don't think the number of screencast matter in this case. I think ember was very clearly presented in this one. Can't wait to see persistence in the next.
By using these rich javascript frameworks you only lessen the requirement of ActionView from the rails stack, there is still tremendous use for the rest of the stack. Especially when view rendering is usually a substantial chunk of your entire response times...
Do you mind elaborating on which task you find Angular is better at than JQuery? I'm trying to figure out whether to use Angular or even Ember for some stuff, but I'm not sure how to integrate these into an app that's already built on rails. I find it much easier to use JQuery along with Handlebars for templating in such cases.
+1
At the risk of being self serving, you can get more info on Ember from http://www.noelrappin.com/mstwjs. Thanks!
+1
Just try both on a small app and see which one you like better. Ember may be a bit short on resources to learn at the moment, but I assume that soon this will going to change.
I've been using ElasticSearch it's going fine, but I'm wondering if it's possible make 'operations' I mean for example how can I get the average or plus two values etc. ?? I'm not sure if can I do this using Tire??
If does anyone knows any solution I really appreciate
Thanks!!
+1.
AngularJS is easier to understand even for frontend developers .
Also very suitable for prototyping
+1
I am in the same boat. Have been researching Ember vs Angular vs whatever. Seems Angular is going to be the winner.
Thanks for the fantastic research work Ryan. Now I know. Angular it is :)
+1
+1
Agreed. This gave me more reasons to use angularjs :).
Read this http://eviltrout.com/2013/02/10/why-discourse-uses-emberjs.html and use Ember :)
+1, Emblem.js is awesome!
This is a nice article that explains that: http://coding.smashingmagazine.com/2012/07/27/journey-through-the-javascript-mvc-jungle/
Great cast!
One question though? How do you set the identity of a user like in A/Bingo?
I want to A/B test for loggin in users and identify them by userid.
This is RAILScasts. Playcasts might use the Play Framework and Nodecasts might use Node.js :smile:
I think you are missing the point. Why will you use a framework just to handle clicks? This screen-cast demonstrates ember using a basic app. Anything too complex might get viewers confused. When building a fairly large application, Ember(and others) can come in really handy.
See this post by David Walsh
Exactly. It is not easy to start writing applications in some js framework while jQuery suits most use cases really well and it so easy to start with. But I found that Angular can solve some tasks in a way that easier to implement than jQuery equivalent. Most important, you don't have to setup full-stack application for Angular. Just include it and start using.
I just wanted to say thanks. Your tip just saved me after almost an hour of looking for a solution. I would guess that line has something to do with IPv6 address support.
I have so much difficulty trying to pick which one to learn... ember, angular, or backbone....
I honestly have no idea, and each thing I read about it further makes me indecisive.
If I had to pick one at this moment, I guess I would choose angular. any thoughts?
Me too. I'm just starting with Angular, but already can't imagine myself doing something in Ember or Backbone :)
Mind sharing your thoughts?
hai, i have error from kaminari pagination. here is the problem:
undefined method `page' for...
controller
def index
@users = User.order("created_at").page(params[:page]).per(50)
end
view:
<%= paginate @users %>
generate:
rails g kaminari:config
rails g kaminari:views default
I have put gem 'kaminari' in my gemfile.
please help me. thanks you.
+1
Yes. It is why I'm learning Node and keeping my eye on Dart. One language for server and client.
I think that the thing that confuses me with all of these javascript frameworks is, why use Rails at this point? I understand the difference between client side and server side frameworks, but all of these seem to be really intrusive to the Rails framework. Instead of using the application controller and returning a JS on
remote: true
or having the coffeescript monitor a click, we have to go through this entirely different framework to accomplish a simple task. Does anyone else feel my pain?Any idea on how to test the mailer for the contact form in Rails 4?
Thanks for this, it made me happy that I went with AngularJS instead of Ember in my last project.