Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Alex Matchneer's Profile

GitHub User: machty

Site: machty.com

Comments by Alex Matchneer

Avatar

Nice episode!

I probably wouldn't have made the separate view for the submit form. Consider the alternative:

js
<form {{action addEntry on="submit"}}>
  {{view Ember.TextField valueBinding="newEntryName"}}
  <input type="submit" value="Add">
</form>

This way, both clicking the submit button and pressing enter within the text field will fire the addEntry action which gets handled by the controller.

Avatar

No, not within a .slim template, but you wouldn't really want to do that anyway. Way better to have it in its own .emblem file so you can precompile it and not even have to include emblem.js as something your browser has to load

Avatar

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

Avatar

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.

Avatar

For an indented Ember-compatible alternative to Handlebars templates, you can try Emblem.js