Homework for April 9th
- Write your first rails app
- Create the Movies app using rails.
- Start with the command:
-
- rails new rails-movies
- Create your controller:
-
- rails g controller movie
- 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.
- Create your views folder:
- app/views/movies Now you have Models, Views, and Controllers for Movies and Movie Searches.
- Add required gems to your Gemfile. (This is instead of 'require'.) Note: you may still need to use require.
- Add a CSS file in app/assets/stylesheets. Rails will include this in your layouts/application.rb view automatically.