Skip to content

Instantly share code, notes, and snippets.

@tensiondriven
Last active December 16, 2015 00:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tensiondriven/5350130 to your computer and use it in GitHub Desktop.
Save tensiondriven/5350130 to your computer and use it in GitHub Desktop.

Homework for April 9th

  1. Write your first rails app
  • Create the Movies app using rails.
  • Start with the command:
    • rails new rails-movies
  1. Create your controller:
    • rails g controller movie
  1. Create ONE or TWO models, ie for movies and searches:
  • app/models/movie.rb - This is a class for a movie.
  • app/models/movie_search.rb - This is a class for a set of search results, which should contain movies. If you want to put everything in one, that's okay, but two is better. These will NOT use a database. These will get their data from the Movies API.
    The API calls will go in the models. The controller will not know that the Models are using an API.
  1. Create your views folder:
  • app/views/movies Now you have Models, Views, and Controllers for Movies and Movie Searches.
  1. Add required gems to your Gemfile. (This is instead of 'require'.) Note: you may still need to use require.
  2. Add a CSS file in app/assets/stylesheets. Rails will include this in your layouts/application.rb view automatically.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment