Objectives |
---|
Compare and contrast parallels between teaching Rails and Express |
Answer questions related to teaching JS first curriculum. |
In a Rails application we would typically have a few main files to discuss when teaching CRUD to students.
config/routes.rb
controllers/todo_controller.rb
views/*.html.erb
models/todo.rb
Gemfile
In a very simple Express CRUD application we have most the routing and control logic in a single application file, similar to a Sinatra application. However, we still have a large number of parallels.
models/todo.js
views/*.ejs
app.js
package.json
With Rails ActiveRecord gives us both a migration system and a modeling system for our database. In the node world the existing solution for this is Sequelize, which is not without it's faults, but gets the job done.
EJS is remarkably similar to ERB, and is great way to prepare them for working with ERB.
Express is relatively simple API to fiddle with and teach to students.