Show
Destroy
An entry
Get it down. Make it good. Share it.
Title
Text
Yesterday, I decided to walk-through the https://guides.emberjs.com/v1.10.0/getting-started/, but with the latest `ember-cli-rails` in Rails 4.2.5. Here are the [results](https://www.afomi.com/frontend/):  ### Setups * javascript stuff - npm, ember-cli * ruby stuff - rails, ember-cli-rails ### Concepts * router -> controller -> component -> view -> template.hbs * In Ember, when a URL changes, a route event is dispatched. The behavior of dispatched events are handled by `router.js`. * Ember data is largish on its own. Check it out. * Router accepts URL patterns. For example, define what responds to `/todos`, or `/images/37`. Routers are opinionated, so a request to `/todos` will expect a Controller called `TodosController`. And since Ember now uses modules, it relies on file naming (and pathing) conventions. So, `TodosController` can live at `/app/controllers/todos.js`, or `/app/pods/todos/controller.js`. `TodoController` will require the same, and handle 1 Todo, rather than all Todos, like `TodoController`. * Controller does stuff * Model serializes and manages data * Views - logic * Templates - view logic and ultimately, HTML ### Gotchas * beware of file-naming. So, be aware of Ember's file-naming conventions, and stick to them. * use [active-model-adapter](https://github.com/ember-data/active-model-adapter) plugin for Ember to help with `isCompleted` -> `is_completed` naming convention conversions * be sure to run `rails g ember:heroku` from your Rails app - more details [here](https://github.com/thoughtbot/ember-cli-rails) - to generate `/bin/heroku_install` More notes to come...
Status
idea
draft
release
personal
Series
Part of a Series?
Bitcoin
On Work
Phoenix Trello Tutorial
Civics
Re Email Address
Tags
ember
×
+
Slug
Url
Image 1
Image 2
Image 3
Visible
Date