diff --git a/.generators b/.generators new file mode 100644 index 00000000..16189766 --- /dev/null +++ b/.generators @@ -0,0 +1,8 @@ + + diff --git a/.gitignore b/.gitignore index cb5b9b3e..d2b370fe 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ # Ignore Byebug command history file. .byebug_history .env +.idea # Ignore master key for decrypting credentials and more. /config/master.key diff --git a/app/controllers/videos_controller.rb b/app/controllers/videos_controller.rb index c9a2bb08..6decde1e 100644 --- a/app/controllers/videos_controller.rb +++ b/app/controllers/videos_controller.rb @@ -1,4 +1,6 @@ class VideosController < ApplicationController + require 'httparty' + before_action :require_video, only: [:show] def index @@ -21,6 +23,36 @@ def show ) end + # ANSEL ADVICE + # Make use of video wrapper code to make call to TMDB + # Get it from rails application. + # In React user enters title and inventory. + # This talks to Rails via the axios + # Rails code then queries tmdb to get details for that movie + # Then add it into your database + # Router is just to selectively show or hide bits of the React app + # It amkes it look like there are different routes to visit, but there really aren't bc single page app + # web server that react runs is special bc requests sent into it get sent to react app running, regardless of path in address bar, anything coming in gets sent to index.js + # + # + # Is it get or post? Get from tmdb + + + # look up the title to get data + # add to db + # doesnt sound like enough to make a helperclass + # put it in an action in controller + # just make use of wrapper + + # def add_new_video.get(url, params) + # SEE VIDEO WRAPPER + # URL = "the url of tmdb --search the video" + # response = HTTParty.get(url, query: params) + # + # we format the response to have the info we want to add to the video table + # then we .save to the video table + # end + private def require_video