diff --git a/Gemfile b/Gemfile index 53dc256..bf28d22 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' gem 'rails' -gem 'rails-api' gem 'sqlite3' gem 'minitest' -gem 'apipie-rails', '>= 0.3.0' +gem 'apipie-rails' +gem 'rails-controller-testing' diff --git a/Gemfile.lock b/Gemfile.lock index 4914280..16c7fc6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,114 +1,164 @@ GEM remote: https://rubygems.org/ specs: - actionmailer (4.2.0) - actionpack (= 4.2.0) - actionview (= 4.2.0) - activejob (= 4.2.0) + actioncable (7.0.4.2) + actionpack (= 7.0.4.2) + activesupport (= 7.0.4.2) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (7.0.4.2) + actionpack (= 7.0.4.2) + activejob (= 7.0.4.2) + activerecord (= 7.0.4.2) + activestorage (= 7.0.4.2) + activesupport (= 7.0.4.2) + mail (>= 2.7.1) + net-imap + net-pop + net-smtp + actionmailer (7.0.4.2) + actionpack (= 7.0.4.2) + actionview (= 7.0.4.2) + activejob (= 7.0.4.2) + activesupport (= 7.0.4.2) mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.0) - actionview (= 4.2.0) - activesupport (= 4.2.0) - rack (~> 1.6.0) - rack-test (~> 0.6.2) - rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.1) - actionview (4.2.0) - activesupport (= 4.2.0) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.0) + actionpack (7.0.4.2) + actionview (= 7.0.4.2) + activesupport (= 7.0.4.2) + rack (~> 2.0, >= 2.2.0) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (7.0.4.2) + actionpack (= 7.0.4.2) + activerecord (= 7.0.4.2) + activestorage (= 7.0.4.2) + activesupport (= 7.0.4.2) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.0.4.2) + activesupport (= 7.0.4.2) builder (~> 3.1) - erubis (~> 2.7.0) - rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.1) - activejob (4.2.0) - activesupport (= 4.2.0) - globalid (>= 0.3.0) - activemodel (4.2.0) - activesupport (= 4.2.0) - builder (~> 3.1) - activerecord (4.2.0) - activemodel (= 4.2.0) - activesupport (= 4.2.0) - arel (~> 6.0) - activesupport (4.2.0) - i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - apipie-rails (0.3.0) - json - arel (6.0.0) - builder (3.2.2) - erubis (2.7.0) - globalid (0.3.0) - activesupport (>= 4.1.0) - hike (1.2.3) - i18n (0.7.0) - json (1.8.2) - loofah (2.0.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (7.0.4.2) + activesupport (= 7.0.4.2) + globalid (>= 0.3.6) + activemodel (7.0.4.2) + activesupport (= 7.0.4.2) + activerecord (7.0.4.2) + activemodel (= 7.0.4.2) + activesupport (= 7.0.4.2) + activestorage (7.0.4.2) + actionpack (= 7.0.4.2) + activejob (= 7.0.4.2) + activerecord (= 7.0.4.2) + activesupport (= 7.0.4.2) + marcel (~> 1.0) + mini_mime (>= 1.1.0) + activesupport (7.0.4.2) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + apipie-rails (0.9.2) + actionpack (>= 5.0) + activesupport (>= 5.0) + builder (3.2.4) + concurrent-ruby (1.2.2) + crass (1.0.6) + date (3.3.3) + erubi (1.12.0) + globalid (1.1.0) + activesupport (>= 5.0) + i18n (1.12.0) + concurrent-ruby (~> 1.0) + loofah (2.19.1) + crass (~> 1.0.2) nokogiri (>= 1.5.9) - mail (2.6.3) - mime-types (>= 1.16, < 3) - mime-types (2.4.3) - mini_portile (0.6.2) - minitest (5.5.0) - multi_json (1.10.1) - nokogiri (1.6.5) - mini_portile (~> 0.6.0) - rack (1.6.0) - rack-test (0.6.2) - rack (>= 1.0) - rails (4.2.0) - actionmailer (= 4.2.0) - actionpack (= 4.2.0) - actionview (= 4.2.0) - activejob (= 4.2.0) - activemodel (= 4.2.0) - activerecord (= 4.2.0) - activesupport (= 4.2.0) - bundler (>= 1.3.0, < 2.0) - railties (= 4.2.0) - sprockets-rails - rails-api (0.3.1) - actionpack (>= 3.2.11) - railties (>= 3.2.11) - rails-deprecated_sanitizer (1.0.3) - activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.5) - activesupport (>= 4.2.0.beta, < 5.0) - nokogiri (~> 1.6.0) - rails-deprecated_sanitizer (>= 1.0.1) - rails-html-sanitizer (1.0.1) - loofah (~> 2.0) - railties (4.2.0) - actionpack (= 4.2.0) - activesupport (= 4.2.0) - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - rake (10.4.2) - sprockets (2.12.3) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sprockets-rails (2.2.2) - actionpack (>= 3.0) - activesupport (>= 3.0) - sprockets (>= 2.8, < 4.0) - sqlite3 (1.3.10) - thor (0.19.1) - thread_safe (0.3.4) - tilt (1.4.1) - tzinfo (1.2.2) - thread_safe (~> 0.1) + mail (2.8.1) + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.0.2) + method_source (1.0.0) + mini_mime (1.1.2) + mini_portile2 (2.8.1) + minitest (5.17.0) + net-imap (0.3.4) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.1) + timeout + net-smtp (0.3.3) + net-protocol + nio4r (2.5.8) + nokogiri (1.14.2) + mini_portile2 (~> 2.8.0) + racc (~> 1.4) + racc (1.6.2) + rack (2.2.6.2) + rack-test (2.0.2) + rack (>= 1.3) + rails (7.0.4.2) + actioncable (= 7.0.4.2) + actionmailbox (= 7.0.4.2) + actionmailer (= 7.0.4.2) + actionpack (= 7.0.4.2) + actiontext (= 7.0.4.2) + actionview (= 7.0.4.2) + activejob (= 7.0.4.2) + activemodel (= 7.0.4.2) + activerecord (= 7.0.4.2) + activestorage (= 7.0.4.2) + activesupport (= 7.0.4.2) + bundler (>= 1.15.0) + railties (= 7.0.4.2) + rails-controller-testing (1.0.5) + actionpack (>= 5.0.1.rc1) + actionview (>= 5.0.1.rc1) + activesupport (>= 5.0.1.rc1) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.5.0) + loofah (~> 2.19, >= 2.19.1) + railties (7.0.4.2) + actionpack (= 7.0.4.2) + activesupport (= 7.0.4.2) + method_source + rake (>= 12.2) + thor (~> 1.0) + zeitwerk (~> 2.5) + rake (13.0.6) + sqlite3 (1.6.1) + mini_portile2 (~> 2.8.0) + thor (1.2.1) + timeout (0.3.2) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + websocket-driver (0.7.5) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + zeitwerk (2.6.7) PLATFORMS ruby DEPENDENCIES - apipie-rails (>= 0.3.0) + apipie-rails minitest rails - rails-api + rails-controller-testing sqlite3 + +BUNDLED WITH + 2.1.4 diff --git a/app/controllers/v1/tweets_controller.rb b/app/controllers/v1/tweets_controller.rb index 72d50f7..f022bff 100644 --- a/app/controllers/v1/tweets_controller.rb +++ b/app/controllers/v1/tweets_controller.rb @@ -1,6 +1,6 @@ module V1 class TweetsController < ApplicationController - before_filter :find_user + before_action :find_user api! def index @@ -43,7 +43,7 @@ def create def update @tweet = @user.tweets.find(params[:id]) - if @tweet.update_attributes(tweet_params) + if @tweet.update(tweet_params) head :no_content else render json: @tweet.errors, status: :unprocessable_entity diff --git a/app/controllers/v1/users_controller.rb b/app/controllers/v1/users_controller.rb index 1d42e98..d06ad48 100644 --- a/app/controllers/v1/users_controller.rb +++ b/app/controllers/v1/users_controller.rb @@ -44,7 +44,7 @@ def create def update @user = User.find(params[:id]) - if @user.update_attributes(user_params) + if @user.update(user_params) head :no_content else render json: @user.errors, status: :unprocessable_entity diff --git a/app/controllers/v2/tweets_controller.rb b/app/controllers/v2/tweets_controller.rb index ab3c537..3853e12 100644 --- a/app/controllers/v2/tweets_controller.rb +++ b/app/controllers/v2/tweets_controller.rb @@ -1,6 +1,6 @@ module V2 class TweetsController < BaseController - before_filter :find_user + before_action :find_user api! def index @@ -43,7 +43,7 @@ def create def update @tweet = @user.tweets.find(params[:id]) - if @tweet.update_attributes(tweet_params) + if @tweet.update(tweet_params) head :no_content else render json: @tweet.errors, status: :unprocessable_entity diff --git a/app/controllers/v2/users_controller.rb b/app/controllers/v2/users_controller.rb index c23704d..7a011b6 100644 --- a/app/controllers/v2/users_controller.rb +++ b/app/controllers/v2/users_controller.rb @@ -31,7 +31,7 @@ def create def update @user = User.find(params[:id]) - if @user.update_attributes(user_params) + if @user.update(user_params) head :no_content else render json: @user.errors, status: :unprocessable_entity diff --git a/config/application.rb b/config/application.rb index e9b25c4..5c0d696 100644 --- a/config/application.rb +++ b/config/application.rb @@ -47,12 +47,8 @@ class Application < Rails::Application # like if you have constraints or database-specific column types # config.active_record.schema_format = :sql - # Enable the asset pipeline - config.assets.enabled = true - - # Version of your assets, change this if you want to expire all your assets - config.assets.version = '1.0' - config.active_support.test_order = :random + + config.active_record.legacy_connection_handling = false end end diff --git a/config/environments/development.rb b/config/environments/development.rb index 14c2078..9cf3013 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -22,11 +22,7 @@ # Only use best-standards-support built into browsers config.action_dispatch.best_standards_support = :builtin - # Do not compress assets - config.assets.compress = false - # Expands the lines which load the assets - config.assets.debug = true config.eager_load = false end diff --git a/config/environments/production.rb b/config/environments/production.rb index a7730c6..8d76fae 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -11,18 +11,6 @@ # Disable Rails's static asset server (Apache or nginx will already do this) config.serve_static_files = false - # Compress JavaScripts and CSS - config.assets.compress = true - - # Don't fallback to assets pipeline if a precompiled asset is missed - config.assets.compile = false - - # Generate digests for assets URLs - config.assets.digest = true - - # Defaults to nil and saved in location specified by config.assets.prefix - # config.assets.manifest = YOUR_PATH - # Specifies the header that your server uses for sending files # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx @@ -45,9 +33,6 @@ # Enable serving of images, stylesheets, and JavaScripts from an asset server # config.action_controller.asset_host = "http://assets.example.com" - # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) - # config.assets.precompile += %w( search.js ) - # Disable delivery errors, bad email addresses will be ignored # config.action_mailer.raise_delivery_errors = false diff --git a/doc/apidoc-onepage.html b/doc/apidoc-onepage.html index a618c73..d19af6e 100644 --- a/doc/apidoc-onepage.html +++ b/doc/apidoc-onepage.html @@ -3,18 +3,19 @@
Another API description
+GET /users/980190962/tweets
-200
-[
- {
- "created_at": "2013-01-25T21:44:16Z",
- "id": 980190962,
- "scheduled_at": "2012-06-27T17:55:59Z",
- "sent": false,
- "text": "MyText",
- "updated_at": "2013-01-25T21:44:17Z",
- "user_id": 980190962
- }
-]
GET /users/980190962/tweets/980190962
-200
-{
- "created_at": "2013-01-25T21:44:16Z",
- "id": 980190962,
- "scheduled_at": "2012-06-27T17:55:59Z",
- "sent": false,
- "text": "MyText",
- "updated_at": "2013-01-25T21:44:17Z",
- "user_id": 980190962
-}
POST /users/980190962/tweets
-{
- "tweet": {
- "scheduled_at": "2012-06-27 17:55:59 UTC",
- "sent": false,
- "text": "MyText",
- "user_id": "980190962"
- }
-}
-201
-{
- "created_at": "2013-01-25T21:44:17Z",
- "id": 980190963,
- "scheduled_at": "2012-06-27T17:55:59Z",
- "sent": false,
- "text": "MyText",
- "updated_at": "2013-01-25T21:44:17Z",
- "user_id": 980190962
-}
Validations:
+Must be a Hash
+Validations:
+Must be one of: true, false, 1, 0.
Validations:
+Must be a number.
+PUT /users/980190962/tweets/980190962
-{
- "tweet": {
- "scheduled_at": "2012-06-27 17:55:59 UTC",
- "sent": false,
- "text": "MyText",
- "user_id": "980190962"
- }
-}
-204
Validations:
+Must be a Hash
+Validations:
+Must be one of: true, false, 1, 0.
Validations:
+Must be a number.
+DELETE /users/980190962/tweets/980190962 -204
GET /users
-200
-[
- {
- "created_at": "2013-01-25T21:44:16Z",
- "id": 298486374,
- "name": "MyString",
- "updated_at": "2013-01-25T21:44:16Z"
- },
- {
- "created_at": "2013-01-25T21:44:16Z",
- "id": 980190962,
- "name": "MyString",
- "updated_at": "2013-01-25T21:44:16Z"
- }
-]
GET /users/980190962
-200
-{
- "created_at": "2013-01-25T21:44:16Z",
- "id": 980190962,
- "name": "MyString",
- "updated_at": "2013-01-25T21:44:16Z"
-}
POST /users
-{
- "user": {
- "name": "MyString"
- }
-}
-201
-{
- "created_at": "2013-01-25T21:44:17Z",
- "id": 980190963,
- "name": "MyString",
- "updated_at": "2013-01-25T21:44:17Z"
-}
Validations:
+Must be a Hash
+Name of the user
+ +Validations:
+Must be a String
+Street name
+ +Validations:
+Must be a String
+Validations:
+Must be a Integer
+Validations:
+Must be a String
+PUT /users/980190962
-{
- "user": {
- "name": "MyString"
- }
-}
-204
Validations:
+Must be a Hash
+Name of the user
+ +Validations:
+Must be a String
+Street name
+ +Validations:
+Must be a String
+Validations:
+Must be a Integer
+Validations:
+Must be a String
+DELETE /users/980190962 -204
GET /users/980190962/tweets
-200
-[
- {
- "created_at": "2013-01-25T21:44:16Z",
- "id": 980190962,
- "scheduled_at": "2012-06-27T17:55:59Z",
- "sent": false,
- "text": "MyText",
- "updated_at": "2013-01-25T21:44:17Z",
- "user_id": 980190962
- }
-]
GET /users/980190962/tweets/980190962
-200
-{
- "created_at": "2013-01-25T21:44:16Z",
- "id": 980190962,
- "scheduled_at": "2012-06-27T17:55:59Z",
- "sent": false,
- "text": "MyText",
- "updated_at": "2013-01-25T21:44:17Z",
- "user_id": 980190962
-}
POST /users/980190962/tweets
-{
- "tweet": {
- "scheduled_at": "2012-06-27 17:55:59 UTC",
- "sent": false,
- "text": "MyText",
- "user_id": "980190962"
- }
-}
-201
-{
- "created_at": "2013-01-25T21:44:17Z",
- "id": 980190963,
- "scheduled_at": "2012-06-27T17:55:59Z",
- "sent": false,
- "text": "MyText",
- "updated_at": "2013-01-25T21:44:17Z",
- "user_id": 980190962
-}
Must be a Hash
+ ] @@ -157,7 +113,9 @@Must be one of: true, false, 1, 0.
Must be a number.
+ ] @@ -194,25 +154,19 @@PUT /users/980190962/tweets/980190962
-{
- "tweet": {
- "scheduled_at": "2012-06-27 17:55:59 UTC",
- "sent": false,
- "text": "MyText",
- "user_id": "980190962"
- }
-}
-204
Must be a Hash
+ ] @@ -241,7 +197,9 @@Must be one of: true, false, 1, 0.
Must be a number.
+ ] @@ -278,17 +238,14 @@DELETE /users/980190962/tweets/980190962 -204
GET /users
-200
-[
- {
- "created_at": "2013-01-25T21:44:16Z",
- "id": 298486374,
- "name": "MyString",
- "updated_at": "2013-01-25T21:44:16Z"
- },
- {
- "created_at": "2013-01-25T21:44:16Z",
- "id": 980190962,
- "name": "MyString",
- "updated_at": "2013-01-25T21:44:16Z"
- }
-]
GET /users/980190962
-200
-{
- "created_at": "2013-01-25T21:44:16Z",
- "id": 980190962,
- "name": "MyString",
- "updated_at": "2013-01-25T21:44:16Z"
-}
POST /users
-{
- "user": {
- "name": "MyString"
- }
-}
-201
-{
- "created_at": "2013-01-25T21:44:17Z",
- "id": 980190963,
- "name": "MyString",
- "updated_at": "2013-01-25T21:44:17Z"
-}
Must be a Hash
+ ]Must be a String
+ ] + + +Name of the user
+ +Must be a String
+ ] + + +Street name
+ +Must be a Integer
+ ] + + +Must be a String
+ ]PUT /users/980190962
-{
- "user": {
- "name": "MyString"
- }
-}
-204
Must be a Hash
+ ]Must be a String
+ ] + + +Name of the user
+ + + +Must be a String
+ ] + + +Street name
+ +Must be a Integer
+ ] + + +Must be a String
+ ]DELETE /users/980190962 -204
Another API description
+| GET /api/v2/users/:user_id/tweets | -List tweets | ++ GET /api/v1/users/:user_id/tweets + | +|
| GET /api/v2/users/:user_id/tweets/:id | -Show a tweet | ++ GET /api/v1/users/:user_id/tweets/:id + | +|
| POST /api/v2/users/:user_id/tweets | -Create a tweet | ++ POST /api/v1/users/:user_id/tweets + | +|
| PUT /api/v2/users/:user_id/tweets/:id | -Update a tweet | ++ PATCH /api/v1/users/:user_id/tweets/:id + | +|
| DELETE /api/v2/users/:user_id/tweets/:id | -Destroy a tweet | ++ PUT /api/v1/users/:user_id/tweets/:id + | ++ |
| + DELETE /api/v1/users/:user_id/tweets/:id + | +
| GET /api/v2/users | -List users | ++ GET /api/v1/users + | ++ |
| + GET /api/v1/users/:id + | +|||
| GET /api/v2/users/:id | -Show an user | ++ POST /api/v1/users + | +|
| POST /api/v2/users | -Create an user | ++ PATCH /api/v1/users/:id + | +|
| PUT /api/v2/users/:id | -Update an user | ++ PUT /api/v1/users/:id + | +|
| DELETE /api/v2/users/:id | -Destroy an user | ++ DELETE /api/v1/users/:id + | +
| Param name | -Description | -||||||
|---|---|---|---|---|---|---|---|
| Param name | +Description | +
|---|---|
|
tweet @@ -175,9 +146,15 @@ Params |
- - Value: Must be a Hash + Validations: +
|
+
| + | +
- - Value: Must be 'true' or 'false' + Validations: +
|
+
@@ -220,7 +205,9 @@ + | + @@ -234,16 +221,25 @@
- - Value: Must be a number. + Validations: +
|
+
-
-
PUT /users/980190962/tweets/980190962
-{
- "tweet": {
- "scheduled_at": "2012-06-27 17:55:59 UTC",
- "sent": false,
- "text": "MyText",
- "user_id": "980190962"
- }
-}
-204
-
- | Param name | -Description | -||||||
|---|---|---|---|---|---|---|---|
| Param name | +Description | +
|---|---|
|
tweet @@ -298,9 +295,15 @@ Params |
- - Value: Must be a Hash + Validations: +
|
+
| + | +
- - Value: Must be 'true' or 'false' + Validations: +
|
+
@@ -343,7 +354,9 @@ + | + @@ -357,16 +370,25 @@
- - Value: Must be a number. + Validations: +
|
+
-
-
DELETE /users/980190962/tweets/980190962 -204+ + + + @@ -402,10 +426,9 @@
POST /users/980190962/tweets
-{
- "tweet": {
- "scheduled_at": "2012-06-27 17:55:59 UTC",
- "sent": false,
- "text": "MyText",
- "user_id": "980190962"
- }
-}
-201
-{
- "created_at": "2013-01-25T21:44:17Z",
- "id": 980190963,
- "scheduled_at": "2012-06-27T17:55:59Z",
- "sent": false,
- "text": "MyText",
- "updated_at": "2013-01-25T21:44:17Z",
- "user_id": 980190962
-}
-
-
-
- | Param name | -Description | -||||||
|---|---|---|---|---|---|---|---|
| Param name | +Description | +
|---|---|
|
tweet @@ -84,9 +69,15 @@ Params |
- - Value: Must be a Hash + Validations: +
|
+
| + | +
- - Value: Must be 'true' or 'false' + Validations: +
|
+
@@ -129,7 +128,9 @@ + | + @@ -143,16 +144,25 @@
- - Value: Must be a number. + Validations: +
|
+
-
-
DELETE /users/980190962/tweets/980190962 -204+ + + + @@ -55,10 +60,9 @@
GET /users/980190962/tweets
-200
-[
- {
- "created_at": "2013-01-25T21:44:16Z",
- "id": 980190962,
- "scheduled_at": "2012-06-27T17:55:59Z",
- "sent": false,
- "text": "MyText",
- "updated_at": "2013-01-25T21:44:17Z",
- "user_id": 980190962
- }
-]
+
+
+
+
@@ -66,10 +60,9 @@ GET /users/980190962/tweets/980190962
-200
-{
- "created_at": "2013-01-25T21:44:16Z",
- "id": 980190962,
- "scheduled_at": "2012-06-27T17:55:59Z",
- "sent": false,
- "text": "MyText",
- "updated_at": "2013-01-25T21:44:17Z",
- "user_id": 980190962
-}
+
+
+
+
@@ -64,10 +60,9 @@ PUT /users/980190962/tweets/980190962
-{
- "tweet": {
- "scheduled_at": "2012-06-27 17:55:59 UTC",
- "sent": false,
- "text": "MyText",
- "user_id": "980190962"
- }
-}
-204
-
-
-
- | Param name | -Description | -||||||
|---|---|---|---|---|---|---|---|
| Param name | +Description | +
|---|---|
|
tweet @@ -75,9 +76,15 @@ Params |
- - Value: Must be a Hash + Validations: +
|
+
| + | +
- - Value: Must be 'true' or 'false' + Validations: +
|
+
@@ -120,7 +135,9 @@ + | + @@ -134,16 +151,25 @@
- - Value: Must be a number. + Validations: +
|
+
-
-
GET /users
-200
-[
- {
- "created_at": "2013-01-25T21:44:16Z",
- "id": 298486374,
- "name": "MyString",
- "updated_at": "2013-01-25T21:44:16Z"
- },
- {
- "created_at": "2013-01-25T21:44:16Z",
- "id": 980190962,
- "name": "MyString",
- "updated_at": "2013-01-25T21:44:16Z"
- }
-]
+
+
+
+
GET /users/980190962
-200
-{
- "created_at": "2013-01-25T21:44:16Z",
- "id": 980190962,
- "name": "MyString",
- "updated_at": "2013-01-25T21:44:16Z"
-}
+
+
+
+
POST /users
-{
- "user": {
- "name": "MyString"
- }
-}
-201
-{
- "created_at": "2013-01-25T21:44:17Z",
- "id": 980190963,
- "name": "MyString",
- "updated_at": "2013-01-25T21:44:17Z"
-}
-
- | Param name | -Description | -||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Param name | +Description | +
|---|---|
|
user - optional + required |
- - Value: Must be a Hash + Validations: +
|
+
|
user[name] - optional + required |
+ Name of the user + +Validations: +
|
+
|
+ user[street] + + optional + , nil allowed + + |
+
+
+ Street name + +Validations: +
|
+
+
|
+ user[number] + + optional + , nil allowed + + |
+
+
+ Validations: +
|
+
+
|
+ user[zip] + + optional + , nil allowed + + |
+
+
+ Validations: +
|
+
+
PUT /users/980190962
-{
- "user": {
- "name": "MyString"
- }
-}
-204
-
- | Param name | -Description | -|||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Param name | +Description | +
|---|---|
|
user - optional + required |
- - Value: Must be a Hash + Validations: +
|
+
|
+ Name of the user + +Validations: +
|
+
+ |
|
+ user[street] + + optional + , nil allowed + + |
+
+
+ Street name + +Validations: +
|
+
+
|
+ user[number] + + optional + , nil allowed + + |
+
+
+ Validations: +
|
+
+
|
+ user[zip] + + optional + , nil allowed + + |
+
+
+ Validations: +
|
+
DELETE /users/980190962 -204+ + + +
POST /users
-{
- "user": {
- "name": "MyString"
- }
-}
-201
-{
- "created_at": "2013-01-25T21:44:17Z",
- "id": 980190963,
- "name": "MyString",
- "updated_at": "2013-01-25T21:44:17Z"
-}
-
-
-
- | Param name | -Description | -||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Param name | +Description | +
|---|---|
|
user - optional + required |
- - Value: Must be a Hash + Validations: +
|
+
|
user[name] - optional + required |
+ Name of the user + +Validations: +
|
+
+
|
+ user[street] + + optional + , nil allowed + + |
+
+
+ Street name + +Validations: +
|
+
+
|
+ user[number] + + optional + , nil allowed + + |
+
+
+ Validations: +
|
+
+
|
+ user[zip] + + optional + , nil allowed + + |
+
+
+ Validations: +
|
+
DELETE /users/980190962 -204+ + + + @@ -55,10 +60,9 @@
GET /users
-200
-[
- {
- "created_at": "2013-01-25T21:44:16Z",
- "id": 298486374,
- "name": "MyString",
- "updated_at": "2013-01-25T21:44:16Z"
- },
- {
- "created_at": "2013-01-25T21:44:16Z",
- "id": 980190962,
- "name": "MyString",
- "updated_at": "2013-01-25T21:44:16Z"
- }
-]
+
+
+
+
@@ -69,10 +60,9 @@ GET /users/980190962
-200
-{
- "created_at": "2013-01-25T21:44:16Z",
- "id": 980190962,
- "name": "MyString",
- "updated_at": "2013-01-25T21:44:16Z"
-}
+
+
+
+
@@ -61,10 +60,9 @@ PUT /users/980190962
-{
- "user": {
- "name": "MyString"
- }
-}
-204
-
-
-
- | Param name | -Description | -|||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Param name | +Description | +
|---|---|
|
user - optional + required |
- - Value: Must be a Hash + Validations: +
|
+
|
+ Name of the user + +Validations: +
|
+
+ |
|
+ user[street] + + optional + , nil allowed + + |
+
+
+ Street name + +Validations: +
|
+
|
+ user[number] + + optional + , nil allowed + + |
+
+
+ Validations: +
|
+
+
|
+ user[zip] + + optional + , nil allowed + + |
+
+
+ Validations: +
|
+
+