From d914bcd1dca0df17c2d3704b7ec39672f7c8e852 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Wed, 13 Sep 2023 04:33:39 -0500 Subject: [PATCH] Complete the planned mission with basic requirements. --- .ruby-version | 1 + app/controllers/movies_controller.rb | 5 +++++ app/helpers/movies_helper.rb | 2 ++ app/views/movies/index.html.erb | 7 +++++++ config/routes.rb | 5 +---- test/controllers/movies_controller_test.rb | 7 +++++++ 6 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 .ruby-version create mode 100644 app/controllers/movies_controller.rb create mode 100644 app/helpers/movies_helper.rb create mode 100644 app/views/movies/index.html.erb create mode 100644 test/controllers/movies_controller_test.rb diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..7bde84d --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +ruby-3.1.2 diff --git a/app/controllers/movies_controller.rb b/app/controllers/movies_controller.rb new file mode 100644 index 0000000..5b1fd53 --- /dev/null +++ b/app/controllers/movies_controller.rb @@ -0,0 +1,5 @@ +class MoviesController < ApplicationController + def index + @movies = ["Iron Man", "Batman"] + end +end diff --git a/app/helpers/movies_helper.rb b/app/helpers/movies_helper.rb new file mode 100644 index 0000000..493eee5 --- /dev/null +++ b/app/helpers/movies_helper.rb @@ -0,0 +1,2 @@ +module MoviesHelper +end diff --git a/app/views/movies/index.html.erb b/app/views/movies/index.html.erb new file mode 100644 index 0000000..8c7ad4c --- /dev/null +++ b/app/views/movies/index.html.erb @@ -0,0 +1,7 @@ +

The only movies that actually matter

+ + diff --git a/config/routes.rb b/config/routes.rb index 262ffd5..b83e046 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,3 @@ Rails.application.routes.draw do - # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html - - # Defines the root path route ("/") - # root "articles#index" + get "movies" => "movies#index" end diff --git a/test/controllers/movies_controller_test.rb b/test/controllers/movies_controller_test.rb new file mode 100644 index 0000000..cfd38a7 --- /dev/null +++ b/test/controllers/movies_controller_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class MoviesControllerTest < ActionDispatch::IntegrationTest + # test "the truth" do + # assert true + # end +end