Skip to content

Commit 002436e

Browse files
committed
Added routes for bookings deletion
1 parent 3668375 commit 002436e

File tree

3 files changed

+242
-2
lines changed

3 files changed

+242
-2
lines changed

config/routes.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55
match 'lucene/rebuild' => 'lucene#rebuild'
66

77
match 'booking/user/:id' => 'bookings#find_by_user', :via => :get
8-
match 'booking' => 'bookings#show', :via => :get
8+
match 'booking/:id' => 'bookings#destroy', :via=> :delete
9+
match 'booking/:id' => 'bookings#show', :via => :get
910
match 'booking' => 'bookings#create', :via => :post
1011

1112
match 'user' => 'users#index', :via => :get
1213
match 'user/new' => 'users#new', :via => :get
1314
match 'user/check' => 'users#check', :default => {:format => 'json'}
1415
match 'user' => 'users#create', :via => :post
1516
match 'user/:id' => 'users#show', :via => :get
16-
match 'user/:id' => 'users#delete', :via => :delete
17+
match 'user/:id' => 'users#destroy', :via => :delete
1718
match 'user/:id' => 'users#update', :via => :put
1819
match 'user/:id/edit' => 'users#edit', :via => :get
1920

db/development.sqlite3

0 Bytes
Binary file not shown.

log/development.log

Lines changed: 239 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7554,3 +7554,242 @@ Offset: 0
75547554
Query:
75557555
Hotel Load (1.0ms) SELECT "hotels".* FROM "hotels" LIMIT 5 OFFSET 0
75567556
Completed 200 OK in 24ms (Views: 15.5ms | ActiveRecord: 1.0ms)
7557+
7558+
7559+
Started POST "/api/lucene/rebuild" for 127.0.0.1 at Wed Jun 15 15:15:26 +0200 2011
7560+
Processing by LuceneController#rebuild as JSON
7561+
Completed 200 OK in 6ms (Views: 5.7ms | ActiveRecord: 0.0ms)
7562+
7563+
7564+
Started DELETE "/api/booking/2" for 127.0.0.1 at Wed Jun 15 15:15:26 +0200 2011
7565+
7566+
ActionController::RoutingError (No route matches "/api/booking/2"):
7567+
7568+
7569+
Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.8ms)
7570+
7571+
7572+
Started POST "/api/lucene/rebuild" for 127.0.0.1 at Wed Jun 15 15:15:45 +0200 2011
7573+
Processing by LuceneController#rebuild as JSON
7574+
Completed 200 OK in 6ms (Views: 5.3ms | ActiveRecord: 0.0ms)
7575+
7576+
7577+
Started DELETE "/api/booking/2" for 127.0.0.1 at Wed Jun 15 15:15:45 +0200 2011
7578+
7579+
ActionController::RoutingError (No route matches "/api/booking/2"):
7580+
7581+
7582+
Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.7ms)
7583+
7584+
7585+
Started POST "/api/lucene/rebuild" for 127.0.0.1 at Wed Jun 15 15:16:10 +0200 2011
7586+
Processing by LuceneController#rebuild as JSON
7587+
Completed 200 OK in 7ms (Views: 6.1ms | ActiveRecord: 0.0ms)
7588+
7589+
7590+
Started DELETE "/api/booking/2" for 127.0.0.1 at Wed Jun 15 15:16:10 +0200 2011
7591+
7592+
ActionController::RoutingError (No route matches "/api/booking/2"):
7593+
7594+
7595+
Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.1ms)
7596+
7597+
7598+
Started POST "/api/lucene/rebuild" for 127.0.0.1 at Wed Jun 15 15:16:34 +0200 2011
7599+
Processing by LuceneController#rebuild as JSON
7600+
Completed 200 OK in 6ms (Views: 5.4ms | ActiveRecord: 0.0ms)
7601+
7602+
7603+
Started DELETE "/api/booking/2" for 127.0.0.1 at Wed Jun 15 15:16:34 +0200 2011
7604+
7605+
ActionController::RoutingError (No route matches "/api/booking/2"):
7606+
7607+
7608+
Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.9ms)
7609+
7610+
7611+
Started POST "/api/lucene/rebuild" for 127.0.0.1 at Wed Jun 15 15:16:55 +0200 2011
7612+
Processing by LuceneController#rebuild as JSON
7613+
Completed 200 OK in 5ms (Views: 5.1ms | ActiveRecord: 0.0ms)
7614+
7615+
7616+
Started DELETE "/api/booking/2" for 127.0.0.1 at Wed Jun 15 15:16:55 +0200 2011
7617+
Processing by BookingsController#show as JSON
7618+
Parameters: {"id"=>"2"}
7619+
SQL (0.7ms)  SELECT name
7620+
FROM sqlite_master
7621+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
7622+

7623+
Booking Load (0.2ms) SELECT "bookings".* FROM "bookings" WHERE ("bookings"."id" = 2) LIMIT 1
7624+
Completed 200 OK in 74ms (Views: 23.5ms | ActiveRecord: 0.9ms)
7625+
7626+
7627+
Started GET "/api/booking/user/5" for 127.0.0.1 at Wed Jun 15 15:16:55 +0200 2011
7628+
Processing by BookingsController#find_by_user as JSON
7629+
Parameters: {"id"=>"5"}
7630+
Booking Load (0.5ms) SELECT "bookings".* FROM "bookings" WHERE (user_id='5')
7631+
User Load (0.2ms) SELECT "users".* FROM "users" WHERE ("users"."id" = 5) LIMIT 1
7632+
Hotel Load (0.3ms) SELECT "hotels".* FROM "hotels" WHERE ("hotels"."id" = 1) LIMIT 1
7633+
CACHE (0.0ms) SELECT "users".* FROM "users" WHERE ("users"."id" = 5) LIMIT 1
7634+
CACHE (0.0ms) SELECT "hotels".* FROM "hotels" WHERE ("hotels"."id" = 1) LIMIT 1
7635+
Completed 200 OK in 137ms (Views: 12.4ms | ActiveRecord: 1.1ms)
7636+
7637+
7638+
Started GET "/api/hotel/search?page=0&size=5" for 127.0.0.1 at Wed Jun 15 15:16:55 +0200 2011
7639+
Processing by HotelsController#search as JSON
7640+
Parameters: {"size"=>"5", "page"=>"0"}
7641+
Size of the list: 5
7642+
Page number: 0
7643+
Offset: 0
7644+
Query:
7645+
Hotel Load (0.6ms) SELECT "hotels".* FROM "hotels" LIMIT 5 OFFSET 0
7646+
Completed 200 OK in 32ms (Views: 24.9ms | ActiveRecord: 0.6ms)
7647+
7648+
7649+
Started POST "/api/lucene/rebuild" for 127.0.0.1 at Wed Jun 15 15:17:12 +0200 2011
7650+
Processing by LuceneController#rebuild as JSON
7651+
Completed 200 OK in 6ms (Views: 5.6ms | ActiveRecord: 0.0ms)
7652+
7653+
7654+
Started GET "/api/booking/user/5" for 127.0.0.1 at Wed Jun 15 15:17:13 +0200 2011
7655+
Processing by BookingsController#find_by_user as JSON
7656+
Parameters: {"id"=>"5"}
7657+
Booking Load (0.5ms) SELECT "bookings".* FROM "bookings" WHERE (user_id='5')
7658+
User Load (0.2ms) SELECT "users".* FROM "users" WHERE ("users"."id" = 5) LIMIT 1
7659+
Hotel Load (0.2ms) SELECT "hotels".* FROM "hotels" WHERE ("hotels"."id" = 1) LIMIT 1
7660+
CACHE (0.0ms) SELECT "users".* FROM "users" WHERE ("users"."id" = 5) LIMIT 1
7661+
CACHE (0.0ms) SELECT "hotels".* FROM "hotels" WHERE ("hotels"."id" = 1) LIMIT 1
7662+
Completed 200 OK in 108ms (Views: 5.4ms | ActiveRecord: 0.9ms)
7663+
7664+
7665+
Started GET "/api/hotel/search?page=0&size=5" for 127.0.0.1 at Wed Jun 15 15:17:13 +0200 2011
7666+
Processing by HotelsController#search as JSON
7667+
Parameters: {"size"=>"5", "page"=>"0"}
7668+
Size of the list: 5
7669+
Page number: 0
7670+
Offset: 0
7671+
Query:
7672+
Hotel Load (0.6ms) SELECT "hotels".* FROM "hotels" LIMIT 5 OFFSET 0
7673+
Completed 200 OK in 28ms (Views: 21.7ms | ActiveRecord: 0.6ms)
7674+
7675+
7676+
Started DELETE "/api/booking/2" for 127.0.0.1 at Wed Jun 15 15:17:28 +0200 2011
7677+
7678+
ActionController::RoutingError (No route matches "/api/booking/2"):
7679+
7680+
7681+
Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.6ms)
7682+
7683+
7684+
Started GET "/api/hotel/search?page=0&size=5" for 127.0.0.1 at Wed Jun 15 15:18:35 +0200 2011
7685+
Processing by HotelsController#search as JSON
7686+
Parameters: {"size"=>"5", "page"=>"0"}
7687+
Size of the list: 5
7688+
Page number: 0
7689+
Offset: 0
7690+
Query:
7691+
Hotel Load (0.7ms) SELECT "hotels".* FROM "hotels" LIMIT 5 OFFSET 0
7692+
Completed 200 OK in 102ms (Views: 73.9ms | ActiveRecord: 0.7ms)
7693+
7694+
7695+
Started GET "/api/booking/user/5" for 127.0.0.1 at Wed Jun 15 15:18:35 +0200 2011
7696+
Processing by BookingsController#find_by_user as JSON
7697+
Parameters: {"id"=>"5"}
7698+
Booking Load (0.5ms) SELECT "bookings".* FROM "bookings" WHERE (user_id='5')
7699+
SQL (0.3ms)  SELECT name
7700+
FROM sqlite_master
7701+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
7702+

7703+
User Load (0.1ms) SELECT "users".* FROM "users" WHERE ("users"."id" = 5) LIMIT 1
7704+
Hotel Load (0.2ms) SELECT "hotels".* FROM "hotels" WHERE ("hotels"."id" = 1) LIMIT 1
7705+
CACHE (0.0ms) SELECT "users".* FROM "users" WHERE ("users"."id" = 5) LIMIT 1
7706+
CACHE (0.0ms) SELECT "hotels".* FROM "hotels" WHERE ("hotels"."id" = 1) LIMIT 1
7707+
Completed 200 OK in 47ms (Views: 5.4ms | ActiveRecord: 1.1ms)
7708+
7709+
7710+
Started DELETE "/api/booking/2" for 127.0.0.1 at Wed Jun 15 15:18:41 +0200 2011
7711+
7712+
AbstractController::ActionNotFound (The action 'delete' could not be found for BookingsController):
7713+
7714+
7715+
Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/unknown_action.erb within rescues/layout (0.5ms)
7716+
7717+
7718+
Started POST "/api/lucene/rebuild" for 127.0.0.1 at Wed Jun 15 15:20:07 +0200 2011
7719+
Processing by LuceneController#rebuild as JSON
7720+
Completed 200 OK in 6ms (Views: 5.9ms | ActiveRecord: 0.0ms)
7721+
7722+
7723+
Started DELETE "/api/booking/2" for 127.0.0.1 at Wed Jun 15 15:20:07 +0200 2011
7724+
Processing by BookingsController#destroy as JSON
7725+
Parameters: {"id"=>"2"}
7726+
Booking Load (0.2ms) SELECT "bookings".* FROM "bookings" WHERE ("bookings"."id" = 2) LIMIT 1
7727+
AREL (0.7ms) DELETE FROM "bookings" WHERE ("bookings"."id" = 2)
7728+
Completed 200 OK in 31ms
7729+
7730+
7731+
Started GET "/api/booking/user/5" for 127.0.0.1 at Wed Jun 15 15:20:16 +0200 2011
7732+
Processing by BookingsController#find_by_user as JSON
7733+
Parameters: {"id"=>"5"}
7734+
Booking Load (0.5ms) SELECT "bookings".* FROM "bookings" WHERE (user_id='5')
7735+
User Load (0.2ms) SELECT "users".* FROM "users" WHERE ("users"."id" = 5) LIMIT 1
7736+
Hotel Load (0.3ms) SELECT "hotels".* FROM "hotels" WHERE ("hotels"."id" = 1) LIMIT 1
7737+
Completed 200 OK in 60ms (Views: 13.2ms | ActiveRecord: 1.9ms)
7738+
7739+
7740+
Started GET "/api/hotel/search?page=0&size=5" for 127.0.0.1 at Wed Jun 15 15:20:17 +0200 2011
7741+
Processing by HotelsController#search as JSON
7742+
Parameters: {"size"=>"5", "page"=>"0"}
7743+
Size of the list: 5
7744+
Page number: 0
7745+
Offset: 0
7746+
Query:
7747+
Hotel Load (0.5ms) SELECT "hotels".* FROM "hotels" LIMIT 5 OFFSET 0
7748+
Completed 200 OK in 20ms (Views: 12.9ms | ActiveRecord: 0.5ms)
7749+
7750+
7751+
Started DELETE "/api/booking/3" for 127.0.0.1 at Wed Jun 15 15:20:19 +0200 2011
7752+
Processing by BookingsController#destroy as JSON
7753+
Parameters: {"id"=>"3"}
7754+
Booking Load (0.2ms) SELECT "bookings".* FROM "bookings" WHERE ("bookings"."id" = 3) LIMIT 1
7755+
AREL (0.3ms) DELETE FROM "bookings" WHERE ("bookings"."id" = 3)
7756+
Completed 200 OK in 19ms
7757+
7758+
7759+
Started GET "/api/hotel/search?page=0&size=5" for 127.0.0.1 at Wed Jun 15 15:20:48 +0200 2011
7760+
Processing by HotelsController#search as JSON
7761+
Parameters: {"size"=>"5", "page"=>"0"}
7762+
Size of the list: 5
7763+
Page number: 0
7764+
Offset: 0
7765+
Query:
7766+
Hotel Load (0.6ms) SELECT "hotels".* FROM "hotels" LIMIT 5 OFFSET 0
7767+
Completed 200 OK in 19ms (Views: 13.1ms | ActiveRecord: 1.1ms)
7768+
7769+
7770+
Started GET "/api/booking/user/5" for 127.0.0.1 at Wed Jun 15 15:20:48 +0200 2011
7771+
Processing by BookingsController#find_by_user as JSON
7772+
Parameters: {"id"=>"5"}
7773+
Booking Load (0.4ms) SELECT "bookings".* FROM "bookings" WHERE (user_id='5')
7774+
Completed 200 OK in 12ms (Views: 5.3ms | ActiveRecord: 0.4ms)
7775+
7776+
7777+
Started GET "/api/hotel/1" for 127.0.0.1 at Wed Jun 15 15:20:53 +0200 2011
7778+
Processing by HotelsController#show as JSON
7779+
Parameters: {"default"=>{"format"=>"json"}, "id"=>"1"}
7780+
Hotel Load (0.2ms) SELECT "hotels".* FROM "hotels" WHERE ("hotels"."id" = 1) LIMIT 1
7781+
Completed 200 OK in 80ms (Views: 70.5ms | ActiveRecord: 0.2ms)
7782+
7783+
7784+
Started DELETE "/api/booking/3" for 127.0.0.1 at Wed Jun 15 15:20:54 +0200 2011
7785+
Processing by BookingsController#destroy as JSON
7786+
Parameters: {"id"=>"3"}
7787+
Booking Load (2.4ms) SELECT "bookings".* FROM "bookings" WHERE ("bookings"."id" = 3) LIMIT 1
7788+
Completed in 26ms
7789+
7790+
ActiveRecord::RecordNotFound (Couldn't find Booking with ID=3):
7791+
app/controllers/bookings_controller.rb:87:in `destroy'
7792+
7793+
Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.1ms)
7794+
Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (10.7ms)
7795+
Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (17.6ms)

0 commit comments

Comments
 (0)