ryanwold.net

A civic-minded citizen seeking the singularity

Back to Entries

Walking through the Ember ToDo App

release
Date: 2015-12-17
Tags: ember

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:

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 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 - to generate /bin/heroku_install

More notes to come...

By Ryan Wold · © 2015–2026 Ryan Wold

Licensed CC BY-NC 4.0. AI training requires a license — machine-readable terms.

Enjoyed this? — any BSV wallet, HandCash, or plain old dollars.

Leave a tip

Tips go directly to a Bitcoin SV address I control — peer to peer, no platform in between. A few thousand satoshis is a fraction of a cent; it's the gesture that counts.

From any BSV wallet

Scan the QR code with your wallet's camera, or copy the address.

177DwUfSTW8RkFBJzYYcgr1YB8ngbhTYAc

With HandCash or any paymail wallet

Paymail is an email-style address for Bitcoin wallets. Send any amount to afomi@handcash.io

First time using Bitcoin? Yours Wallet is an open-source browser extension wallet, and HandCash is an easy mobile wallet — either takes a minute to set up.

Prefer regular money? Support via OpenCollective.