-
-
Save ratnikov/785528 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Started GET "/companies/3/tickets/new" for 127.0.0.1 at 2011-01-18 20:34:21 -0500 | |
Processing by TicketsController#new as HTML | |
Parameters: {"company_id"=>"3"} | |
SQL (0.4ms) SHOW TABLES | |
User Load (0.3ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 1) LIMIT 1 | |
CACHE (0.0ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 1) LIMIT 1 | |
Completed in 98ms | |
ActiveRecord::RecordNotFound (Couldn't find Company without an ID): | |
app/controllers/tickets_controller.rb:54:in `find_company' | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.2ms) | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (3.7ms) | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (8.8ms) | |
Started GET "/companies/3/tickets/new" for 127.0.0.1 at 2011-01-18 20:34:22 -0500 | |
Processing by TicketsController#new as HTML | |
Parameters: {"company_id"=>"3"} | |
SQL (0.7ms) SHOW TABLES | |
User Load (1.1ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 1) LIMIT 1 | |
CACHE (0.0ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 1) LIMIT 1 | |
Completed in 107ms | |
ActiveRecord::RecordNotFound (Couldn't find Company without an ID): | |
app/controllers/tickets_controller.rb:54:in `find_company' | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.2ms) | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (3.6ms) | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (8.7ms) | |
Started GET "/companies/3/tickets/new" for 127.0.0.1 at 2011-01-18 20:34:22 -0500 | |
Processing by TicketsController#new as HTML | |
Parameters: {"company_id"=>"3"} | |
SQL (0.4ms) SHOW TABLES | |
User Load (0.3ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 1) LIMIT 1 | |
CACHE (0.0ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 1) LIMIT 1 | |
Completed in 103ms | |
ActiveRecord::RecordNotFound (Couldn't find Company without an ID): | |
app/controllers/tickets_controller.rb:54:in `find_company' | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.2ms) | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (3.6ms) | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (8.7ms) | |
Started GET "/companies/3/tickets/new" for 127.0.0.1 at 2011-01-18 20:34:22 -0500 | |
Processing by TicketsController#new as HTML | |
Parameters: {"company_id"=>"3"} | |
SQL (0.4ms) SHOW TABLES | |
User Load (0.5ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 1) LIMIT 1 | |
CACHE (0.0ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 1) LIMIT 1 | |
Completed in 103ms | |
ActiveRecord::RecordNotFound (Couldn't find Company without an ID): | |
app/controllers/tickets_controller.rb:54:in `find_company' | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.2ms) | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (3.7ms) | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (8.8ms) | |
Started GET "/companies/3/tickets/new" for 127.0.0.1 at 2011-01-18 20:34:23 -0500 | |
Processing by TicketsController#new as HTML | |
Parameters: {"company_id"=>"3"} | |
SQL (0.4ms) SHOW TABLES | |
User Load (0.3ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 1) LIMIT 1 | |
CACHE (0.0ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 1) LIMIT 1 | |
Completed in 98ms | |
ActiveRecord::RecordNotFound (Couldn't find Company without an ID): | |
app/controllers/tickets_controller.rb:54:in `find_company' | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.4ms) | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (3.5ms) | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (8.9ms) | |
Started GET "/companies/3/tickets/new" for 127.0.0.1 at 2011-01-18 20:34:23 -0500 | |
Processing by TicketsController#new as HTML | |
Parameters: {"company_id"=>"3"} | |
SQL (1.3ms) SHOW TABLES | |
User Load (0.3ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 1) LIMIT 1 | |
CACHE (0.0ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 1) LIMIT 1 | |
Completed in 109ms | |
ActiveRecord::RecordNotFound (Couldn't find Company without an ID): | |
app/controllers/tickets_controller.rb:54:in `find_company' | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.3ms) | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (4.3ms) | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (10.6ms) | |
Started GET "/companies/3/tickets/new" for 127.0.0.1 at 2011-01-18 20:34:23 -0500 | |
Processing by TicketsController#new as HTML | |
Parameters: {"company_id"=>"3"} | |
SQL (0.4ms) SHOW TABLES | |
User Load (0.3ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 1) LIMIT 1 | |
CACHE (0.0ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 1) LIMIT 1 | |
Completed in 100ms | |
ActiveRecord::RecordNotFound (Couldn't find Company without an ID): | |
app/controllers/tickets_controller.rb:54:in `find_company' | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.1ms) | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (3.5ms) | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (8.3ms) | |
Started GET "/companies/3/tickets/new" for 127.0.0.1 at 2011-01-18 20:34:23 -0500 | |
Processing by TicketsController#new as HTML | |
Parameters: {"company_id"=>"3"} | |
SQL (0.5ms) SHOW TABLES | |
User Load (0.3ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 1) LIMIT 1 | |
CACHE (0.0ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 1) LIMIT 1 | |
Completed in 108ms | |
ActiveRecord::RecordNotFound (Couldn't find Company without an ID): | |
app/controllers/tickets_controller.rb:54:in `find_company' | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.3ms) | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (4.0ms) | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (12.9ms) | |
Started GET "/companies/3/tickets/new" for 127.0.0.1 at 2011-01-18 20:34:23 -0500 | |
Processing by TicketsController#new as HTML | |
Parameters: {"company_id"=>"3"} | |
SQL (0.5ms) SHOW TABLES | |
User Load (0.6ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 1) LIMIT 1 | |
CACHE (0.0ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 1) LIMIT 1 | |
Completed in 103ms | |
ActiveRecord::RecordNotFound (Couldn't find Company without an ID): | |
app/controllers/tickets_controller.rb:54:in `find_company' | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.2ms) | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (3.9ms) | |
Rendered /Users/esparkman/.rvm/gems/ruby-1.9.2-p136@rails3/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (9.3ms) |
This file contains hidden or 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
class TicketsController < ApplicationController | |
def show | |
@ticket = Ticket.find(params[:id]) | |
# @comments = Comment.all | |
# @comment = @ticket.comments.build | |
end | |
def new | |
@ticket = ticketable.tickets.build | |
#@ticket = @person.tickets.build | |
end | |
def create | |
@ticket = ticketable.ticket.build(params[:ticket]) | |
# @user = current_user | |
if @ticket.save | |
redirect_to @ticket, :notice => 'Ticket was created successfully' | |
else | |
flash[:notice] = 'Ticket was not created Successfully.' | |
render = 'new' | |
end | |
end | |
def edit | |
end | |
def update | |
if @ticket.update_attributes(params[:ticket]) | |
flash[:notice] = "Ticket has been updated." | |
redirect_to [@person, @ticket] | |
else | |
flash[:alert] = "Ticket has not been updated." | |
render :action => "edit" | |
end | |
end | |
def destroy | |
@ticket.destroy | |
flash[:notice] = "Ticket has been deleted." | |
redirect_to @person | |
end | |
private | |
def ticketable | |
find_company || find_person || render(:text => 'Huh?', :status => 404) | |
end | |
def find_company | |
(id = params[:company_id]) ? Company.find(id) : nil | |
end | |
def find_person | |
(id = params[:person_id]) ? Person.find(id) : nil | |
end | |
def find_user | |
(id = params[:user_id]) ? User.find(id) : nil | |
end | |
def find_ticket | |
@ticket = @person.tickets.find(params[:id]) | |
end | |
end |
This file contains hidden or 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
ActiveRecord::RecordNotFound in TicketsController#new | |
Couldn't find Company without an ID | |
Rails.root: /Users/esparkman/Programming/Rails/clientmanager | |
Application Trace | Framework Trace | Full Trace | |
activerecord (3.0.3) lib/active_record/relation/finder_methods.rb:279:in `find_with_ids' | |
activerecord (3.0.3) lib/active_record/relation/finder_methods.rb:107:in `find' | |
activerecord (3.0.3) lib/active_record/base.rb:439:in `find' | |
app/controllers/tickets_controller.rb:54:in `find_company' | |
activesupport (3.0.3) lib/active_support/callbacks.rb:451:in `_run__619994539442520202__process_action__2447567974102704604__callbacks' | |
activesupport (3.0.3) lib/active_support/callbacks.rb:409:in `_run_process_action_callbacks' | |
activesupport (3.0.3) lib/active_support/callbacks.rb:93:in `run_callbacks' | |
actionpack (3.0.3) lib/abstract_controller/callbacks.rb:17:in `process_action' | |
actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action' | |
activesupport (3.0.3) lib/active_support/notifications.rb:52:in `block in instrument' | |
activesupport (3.0.3) lib/active_support/notifications/instrumenter.rb:21:in `instrument' | |
activesupport (3.0.3) lib/active_support/notifications.rb:52:in `instrument' | |
actionpack (3.0.3) lib/action_controller/metal/instrumentation.rb:29:in `process_action' | |
actionpack (3.0.3) lib/action_controller/metal/rescue.rb:17:in `process_action' | |
actionpack (3.0.3) lib/abstract_controller/base.rb:120:in `process' | |
actionpack (3.0.3) lib/abstract_controller/rendering.rb:40:in `process' | |
actionpack (3.0.3) lib/action_controller/metal.rb:138:in `dispatch' | |
actionpack (3.0.3) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch' | |
actionpack (3.0.3) lib/action_controller/metal.rb:178:in `block in action' | |
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:62:in `call' | |
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:62:in `dispatch' | |
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:27:in `call' | |
rack-mount (0.6.13) lib/rack/mount/route_set.rb:148:in `block in call' | |
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:93:in `block in recognize' | |
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:110:in `optimized_each' | |
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:92:in `recognize' | |
rack-mount (0.6.13) lib/rack/mount/route_set.rb:139:in `call' | |
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:492:in `call' | |
haml (3.0.25) lib/sass/plugin/rack.rb:41:in `call' | |
actionpack (3.0.3) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call' | |
actionpack (3.0.3) lib/action_dispatch/middleware/head.rb:14:in `call' | |
rack (1.2.1) lib/rack/methodoverride.rb:24:in `call' | |
actionpack (3.0.3) lib/action_dispatch/middleware/params_parser.rb:21:in `call' | |
actionpack (3.0.3) lib/action_dispatch/middleware/flash.rb:182:in `call' | |
actionpack (3.0.3) lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call' | |
actionpack (3.0.3) lib/action_dispatch/middleware/cookies.rb:295:in `call' | |
activerecord (3.0.3) lib/active_record/query_cache.rb:32:in `block in call' | |
activerecord (3.0.3) lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache' | |
activerecord (3.0.3) lib/active_record/query_cache.rb:12:in `cache' | |
activerecord (3.0.3) lib/active_record/query_cache.rb:31:in `call' | |
activerecord (3.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:353:in `call' | |
actionpack (3.0.3) lib/action_dispatch/middleware/callbacks.rb:46:in `block in call' | |
activesupport (3.0.3) lib/active_support/callbacks.rb:415:in `_run_call_callbacks' | |
actionpack (3.0.3) lib/action_dispatch/middleware/callbacks.rb:44:in `call' | |
rack (1.2.1) lib/rack/sendfile.rb:107:in `call' | |
actionpack (3.0.3) lib/action_dispatch/middleware/remote_ip.rb:48:in `call' | |
actionpack (3.0.3) lib/action_dispatch/middleware/show_exceptions.rb:46:in `call' | |
railties (3.0.3) lib/rails/rack/logger.rb:13:in `call' | |
rack (1.2.1) lib/rack/runtime.rb:17:in `call' | |
activesupport (3.0.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call' | |
rack (1.2.1) lib/rack/lock.rb:11:in `block in call' | |
<internal:prelude>:10:in `synchronize' | |
rack (1.2.1) lib/rack/lock.rb:11:in `call' | |
actionpack (3.0.3) lib/action_dispatch/middleware/static.rb:30:in `call' | |
railties (3.0.3) lib/rails/application.rb:168:in `call' | |
railties (3.0.3) lib/rails/application.rb:77:in `method_missing' | |
railties (3.0.3) lib/rails/rack/log_tailer.rb:14:in `call' | |
rack (1.2.1) lib/rack/content_length.rb:13:in `call' | |
rack (1.2.1) lib/rack/handler/webrick.rb:52:in `service' | |
/Users/esparkman/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service' | |
/Users/esparkman/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run' | |
/Users/esparkman/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread' | |
Request | |
Parameters: | |
{"company_id"=>"3"} | |
Show session dump | |
Show env dump | |
Response | |
Headers: | |
None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment