Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Water - Leah and Mackenzie #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .generators
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<Settings><!--This file was automatically generated by Ruby plugin.
You are allowed to:
1. Reorder generators
2. Remove generators
3. Add installed generators
To add new installed generators automatically delete this file and reload the project.
--><GeneratorsGroup><Generator name="active_record:migration" /><Generator name="active_record:model" /><Generator name="active_record:observer" /><Generator name="active_record:session_migration" /><Generator name="controller" /><Generator name="erb:controller" /><Generator name="erb:mailer" /><Generator name="erb:scaffold" /><Generator name="generator" /><Generator name="helper" /><Generator name="integration_test" /><Generator name="mailer" /><Generator name="metal" /><Generator name="migration" /><Generator name="model" /><Generator name="model_subclass" /><Generator name="observer" /><Generator name="performance_test" /><Generator name="plugin" /><Generator name="resource" /><Generator name="scaffold" /><Generator name="scaffold_controller" /><Generator name="session_migration" /><Generator name="stylesheets" /><Generator name="test_unit:controller" /><Generator name="test_unit:helper" /><Generator name="test_unit:integration" /><Generator name="test_unit:mailer" /><Generator name="test_unit:model" /><Generator name="test_unit:observer" /><Generator name="test_unit:performance" /><Generator name="test_unit:plugin" /><Generator name="test_unit:scaffold" /></GeneratorsGroup></Settings>
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# Ignore Byebug command history file.
.byebug_history
.env
.idea

# Ignore master key for decrypting credentials and more.
/config/master.key
Expand Down
32 changes: 32 additions & 0 deletions app/controllers/videos_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class VideosController < ApplicationController
require 'httparty'

before_action :require_video, only: [:show]

def index
Expand All @@ -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
Expand Down