Here we continue our look into Ember.js. First we add a JSON API to persist the entries through ember-data. Then we finish up the project by adding a computed property and a view object.
If you're going to keep previewing JavaScript frameworks can you please build a new app rather than do Raffler all over again. I get that it allows us to compare, but it also gets really samey-samey after a watching it being built 3,4,5 times.
I have to agree with this. Ryan normally provides an amazing resource in Railscasts, but I find the raffler example too contrived to be useful. Especially for a pro cast.
Ember Data expects the server to respond JSON with errors as the root key, then the attribute name with the errors nested inside of that. You can basically do the following in Rails and Ember will accept it.
This will set 'isError' on that model and will remain at isError (and refuse to commit) until the attributes that the server said had errors are changed.
Ryan, I hope you like Backbone best :), and use it instead of the others if you go deeper into these frameworks, which I also hope you do--rather than continuing to introduce new ones.
Having seen your coverage of Backbone, Angular, Ember etc, I'd feel pretty confident about learning batman.js on my own, for example, if I felt there was a need, and I assume it'd be similar for other subscribers. However, I'd really like to see you go deeper into how Backbone and Rails can be used together. Just my two cents.
The only suggestion I have is to include testing in all new episodes, it would add a lot of value to your screencasts and I know new developers like myself would appreciate it. Hell even if you don't cover the tests in the screencast but include them in the source code I would learn something.
JS frameworks interact identically with all server-side frameworks. Rails integration process is tivial and is not worth half of all last month's episodes
Thanks for the Ember series, Ryan. ExtJS has taught me how NOT to do SPAs, now I'm looking for ways to do them right. Will there be, or could there be, an Ember Part 3 episode covering validation, error handling, and testing?
Thank you very much for covering some Ember.js casts, it was enough for me to get me to start using it. Like giving me the right keys to open the doors I need.
I didn't miss tests like others suggested, my opinion is that it keeps you up in speed with covering several subjects in a short time.
To all the guys with suggestions to make the casts more sophisticated, packed with tests or other app types, don't need another peepcode.com site. I like the weekly and relatively short casts.
Raffler.EntriesController = Ember.ArrayController.extend
# include the following method.
removeItem: (obj) ->
obj.get('content').deleteRecord()
@store.commit()
My issue was that I was not calling 'deleteRecord()' on the 'content'.
Nice episode!
I probably wouldn't have made the separate view for the submit form. Consider the alternative:
This way, both clicking the submit button and pressing enter within the text field will fire the
addEntryaction which gets handled by the controller.I'm really curious to see Ryan's take on http://batmanjs.org/ (please do cover it)
+1.2
+1
+1
+1
If you're going to keep previewing JavaScript frameworks can you please build a new app rather than do Raffler all over again. I get that it allows us to compare, but it also gets really samey-samey after a watching it being built 3,4,5 times.
So true +1
It's sometimes so boring to see the same functions all over.
What do you suggest he builds? I think the point is to just show the basics of working with the technology. I'm happy with samey.
There's a ton of simple apps he could make. A blog, a forum, a store etc
I have to agree with this. Ryan normally provides an amazing resource in Railscasts, but I find the raffler example too contrived to be useful. Especially for a pro cast.
It is samey but it demonstrates all the things you need to know about these frameworks.
I'd expect these screencasts to take a lot longer to produce if Ryan had to write new boilerplate for each one.
When server side validation fails how does ember handle it?
I assume it is up to you and what status you get from your JSON call
Ember Data expects the server to respond JSON with errors as the root key, then the attribute name with the errors nested inside of that. You can basically do the following in Rails and Ember will accept it.
This will set 'isError' on that model and will remain at isError (and refuse to commit) until the attributes that the server said had errors are changed.
If there was a railscast I'd wish it was covered with tests, then this is the one.
+1
Ryan what would you choose between BackboneJS, Ember or Angular ? I really like Angular.. what do you think ?
Ryan, I hope you like Backbone best :), and use it instead of the others if you go deeper into these frameworks, which I also hope you do--rather than continuing to introduce new ones.
Having seen your coverage of Backbone, Angular, Ember etc, I'd feel pretty confident about learning batman.js on my own, for example, if I felt there was a need, and I assume it'd be similar for other subscribers. However, I'd really like to see you go deeper into how Backbone and Rails can be used together. Just my two cents.
Great episode as always.
The only suggestion I have is to include testing in all new episodes, it would add a lot of value to your screencasts and I know new developers like myself would appreciate it. Hell even if you don't cover the tests in the screencast but include them in the source code I would learn something.
Railscasts make me more and more sad lately: boring reviews of monstrous js-frameworks instead of hardcore rails features.
Had I wanted to be js-guru I would have subscribed to something js-oriented, not rails.
It's time to be renamed to jscasts. Waiting for node.js reviews as a part of digging inside trash process.
Rails gurus should probably have a pretty good idea how client side js frameworks work with Rails.
JS frameworks interact identically with all server-side frameworks. Rails integration process is tivial and is not worth half of all last month's episodes
Yes, I also find js-episodes quite boring and distracting from the Rails theme
Thanks for the Ember series, Ryan. ExtJS has taught me how NOT to do SPAs, now I'm looking for ways to do them right. Will there be, or could there be, an Ember Part 3 episode covering validation, error handling, and testing?
Hi Ryan,
Thank you very much for covering some Ember.js casts, it was enough for me to get me to start using it. Like giving me the right keys to open the doors I need.
I didn't miss tests like others suggested, my opinion is that it keeps you up in speed with covering several subjects in a short time.
To all the guys with suggestions to make the casts more sophisticated, packed with tests or other app types, don't need another peepcode.com site. I like the weekly and relatively short casts.
Keep up the good work Ryan, keep it simple!
Cheers Ryan, much appreciated.
One thing tho (that doesn't really matter!)...
entires_controller.js.coffee should be entries_controller.js.coffee surely?
+1 on Rachid comments - one of the things I love about railscasts is how succinct they are.
I also had to commit the record creation, here's my
addEntry(ember 1.0.0-rc.1)... I see Ryan adds it at the end of the episode, I had to do it when I first implemented the storeage
What is the proper way to delete an Entry?
Ok. Found it!
Raffler.EntriesController = Ember.ArrayController.extend # include the following method. removeItem: (obj) -> obj.get('content').deleteRecord() @store.commit()My issue was that I was not calling 'deleteRecord()' on the 'content'.
On REVISION: 12 it's not needed anymore. obj.deleteRecord() would suffice.
First sign in through GitHub to post a comment.