diff --git a/app/controllers/movies_controller.rb b/app/controllers/movies_controller.rb
index d8ce621..d5595db 100644
--- a/app/controllers/movies_controller.rb
+++ b/app/controllers/movies_controller.rb
@@ -13,8 +13,21 @@ class MoviesController < ApplicationController
end
def update
@movie = Movie.find(params[:id])
- movie_params = params.require(:movie).permit(:title, :description, :rating, :released_on, :total_gross)
@movie.update(movie_params)
redirect_to @movie
end
+ def new
+ @movie = Movie.new
+ end
+ def create
+ @movie = Movie.new(movie_params)
+ @movie.save
+ redirect_to @movie
+ end
+
+ private
+
+ def movie_params
+ params.require(:movie).permit(:title, :description, :rating, :released_on, :total_gross)
+ end
end
diff --git a/app/views/movies/index.html.erb b/app/views/movies/index.html.erb
index 52f31a3..b75de10 100644
--- a/app/views/movies/index.html.erb
+++ b/app/views/movies/index.html.erb
@@ -17,4 +17,7 @@
<% end %>
+