forked from Ada-C9/VideoStoreAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
57 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
class RentalsController < ApplicationController | ||
|
||
# def check_out | ||
# | ||
# rental = Rental.new(rental_params) | ||
# if rental.save | ||
# | ||
# if @rental | ||
# | ||
# render json: @rental.as_json(rental.customer_id,rental.video_id),status: :ok | ||
# | ||
# else | ||
# render json: {ok: false,errors:"movie not found"}, status: :not_found | ||
# end | ||
# | ||
# end | ||
# | ||
# def check_in | ||
# end | ||
# | ||
# def rentals_params | ||
# return params.permit(:customer_id,:movie_id,:due_date,:checkout_date) | ||
# end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
Rails.application.routes.draw do | ||
|
||
|
||
resources :movies, only: [:index, :show, :create] | ||
resources :customers, only: [:index] | ||
|
||
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require "test_helper" | ||
|
||
|
||
# describe RentalsController do | ||
# let(:rental_data) { | ||
# { | ||
# customer_id: 1, | ||
# movie_id: 1 | ||
# | ||
# } | ||
# } | ||
# | ||
# it "Creates a new rental" do | ||
# proc{ | ||
# post rentals_path, params: rental_data | ||
# }.must_change 'Rental.count',1 | ||
# must_respond_with :success | ||
# | ||
# end | ||
# | ||
# end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters