Skip to content
This repository has been archived by the owner on Apr 24, 2019. It is now read-only.

When creating a new ticket for an event as admin, non-number input will output a nasty stack trace #50

Open
dmotles opened this issue Jun 28, 2011 · 0 comments
Assignees
Milestone

Comments

@dmotles
Copy link
Contributor

dmotles commented Jun 28, 2011

Steps:

  1. create an event
  2. click create ticket so the url looks like [host]/events/1/tickets/new
  3. put a number like 600 in the cost field
  4. put something like "over 9000" in the Available field
  5. click "create ticket"

You get the following:

NoMethodError in Tickets#create

Showing /home/dmotles/code/plas/app/views/tickets/_form.html.erb where line #1 raised:

undefined method `model_name' for NilClass:Class
Extracted source (around line #1):

1: <%= form_for ([@event, @ticket])  do |f| %>
2:   <% if @ticket.errors.any? %>
3:     <div id="error_explanation">
4:       <h2><%= pluralize(@ticket.errors.count, "error") %> prohibited this ticket from being saved:</h2>
Trace of template inclusion: app/views/tickets/new.html.erb

Rails.root: /home/dmotles/code/plas

Application Trace | Framework Trace | Full Trace
app/views/tickets/_form.html.erb:1:in `_app_views_tickets__form_html_erb__3302624983022953928_39195520_3150842096570869018'
app/views/tickets/new.html.erb:3:in `_app_views_tickets_new_html_erb___1007846872533634996_39238320__3039767047594116635'
app/controllers/tickets_controller.rb:62:in `block (2 levels) in create'
app/controllers/tickets_controller.rb:57:in `create'
lib/rack/firebug_logger.rb:9:in `call'
lib/rack/firebug_logger.rb:9:in `call'
Request

Parameters:

{"utf8"=>"✓",
 "authenticity_token"=>"S5fZlj8+6u5+FXwWAj9nkxs/chCR16+CsRnnu5rEjds=",
 "ticket"=>{"name"=>"Registration for one person",
 "cents"=>"600",
 "available"=>"over 9000",
 "date_open(1i)"=>"2011",
 "date_open(2i)"=>"6",
 "date_open(3i)"=>"28",
 "date_open(4i)"=>"00",
 "date_open(5i)"=>"54",
 "date_closed(1i)"=>"2011",
 "date_closed(2i)"=>"6",
 "date_closed(3i)"=>"28",
 "date_closed(4i)"=>"00",
 "date_closed(5i)"=>"54"},
 "commit"=>"Create Ticket",
 "event_id"=>"1"}
Show session dump

Show env dump

Response

Headers:

None
@ghost ghost assigned binarycleric Nov 30, 2011
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants