api_flashcards 0.0.1.5 → 0.0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66e4d5caa3c8ccc05ee39f32a206a2cb13203617
4
- data.tar.gz: 14b1902a40b2a587f0ff40288cba2689fa92d3c2
3
+ metadata.gz: 705a5c865fb0cdda372c4b038320f13844948e0d
4
+ data.tar.gz: cb8dbffcbd9996449d4eda4c3f3ee45295c0a024
5
5
  SHA512:
6
- metadata.gz: c7fbd0ba4b43f8563a874112944e2b152d9169b29e4647973a1cb1860808b2a340ca5b6db0924a94b89344399b28f441dde4dd69c6b892838505336419ed642e
7
- data.tar.gz: 2d0f24b9a1d09fe63cf25527c39871888f6607c51eeba0e7bba116ff3c20be13e0beb7e3f4d912fd389b165874a6b13803a02c1c3e345e1ea583b09572d342c8
6
+ metadata.gz: ee0ab7db9af07b8c8179cf92b4b772bb58a0334f539bc29c02f1cc189d023f881358e48a44e66bb92d7c8040dd2ff308dcc2e8d7feddc341f3164b3ec1427955
7
+ data.tar.gz: db7bd48ff16c68a2e8ba0f21d5f815a65402ec83d5db5a3e1c3abb2a0557bc6cd9190cb6449a7d2ae639be29ab6014dac36e764e22614dd1731257fa993694ec
@@ -1,2 +1,2 @@
1
1
  = ApiFlashcards
2
- [![Build Status](https://travis-ci.org/Shkrt/api_flashcards.svg?branch=auth)](https://travis-ci.org/Shkrt/api_flashcards)
2
+ {<img src="https://travis-ci.org/Shkrt/api_flashcards.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/Shkrt/api_flashcards]
@@ -0,0 +1,51 @@
1
+ module ApiFlashcards
2
+ module Api
3
+ module V1
4
+ class CardsController < ApplicationController
5
+ def index
6
+ @cards = current_user.cards.all.order("review_date")
7
+ end
8
+
9
+ def new
10
+ @card = Card.new
11
+ end
12
+
13
+ def edit
14
+ end
15
+
16
+ def create
17
+ @card = current_user.cards.build(card_params)
18
+ if @card.save
19
+ redirect_to cards_path
20
+ else
21
+ respond_with @card
22
+ end
23
+ end
24
+
25
+ def update
26
+ if @card.update(card_params)
27
+ respond_to do |format|
28
+ @cards = current_user.cards
29
+ format.html { redirect_to cards_path }
30
+ format.js { render :index }
31
+ end
32
+ else
33
+ respond_with @card
34
+ end
35
+ end
36
+
37
+ def destroy
38
+ @card.destroy
39
+ respond_with @card
40
+ end
41
+
42
+ def remove_picture
43
+ @card = Card.find(params[:id])
44
+ @card.remote_image = nil
45
+ @card.save
46
+ redirect_to edit_card_path(@card)
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -1,5 +1,5 @@
1
1
  module ApiFlashcards
2
- class ApplicationController < ActionController::Base
2
+ class ApplicationController < ActionController::API
3
3
  before_action :authenticate_basic
4
4
  layout false
5
5
 
@@ -0,0 +1,7 @@
1
+ module ApiFlashcards
2
+ module Concerns
3
+ module Block
4
+ extend ActiveSupport::Concern
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ApiFlashcards
2
+ module Concerns
3
+ module Card
4
+ extend ActiveSupport::Concern
5
+ end
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module ApiFlashcards
2
- VERSION = "0.0.1.5"
2
+ VERSION = "0.0.1.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_flashcards
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.5
4
+ version: 0.0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shkrt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-29 00:00:00.000000000 Z
11
+ date: 2015-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 4.2.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: rails-api
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: pg
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -106,9 +120,12 @@ files:
106
120
  - Rakefile
107
121
  - app/assets/javascripts/api_flashcards/application.js
108
122
  - app/assets/stylesheets/api_flashcards/application.css
123
+ - app/controllers/api_flashcards/api/v1/cards_controller.rb
109
124
  - app/controllers/api_flashcards/application_controller.rb
110
125
  - app/controllers/api_flashcards/test_controller.rb
111
126
  - app/helpers/api_flashcards/application_helper.rb
127
+ - app/models/api_flashcards/concerns/block.rb
128
+ - app/models/api_flashcards/concerns/card.rb
112
129
  - app/models/api_flashcards/concerns/user.rb
113
130
  - app/views/api_flashcards/test/hello.html.erb
114
131
  - config/routes.rb