Hello
I am trying to get going with rails.
After much angst I have now got the database up and running, rails is
installed and I can get to the point where I get this response
Unknown action
No action responded to new
- which seems to be a good sign - the tutorials say this is what should
happen
So the next step is to add scaffold :registration into
registration_controller.rb in cotnrollers, so it now looks like this:
class RegistrationController < ApplicationController
model :registration
scaffold :registration
end
But now when I hit refresh, this is what I get - can anyone help? I have no
idea how to move forward from here.
Thanks in advance -
andrew DOT stuart AT xse DOT com DOT au
NoMethodError in Registration#new
Showing
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/tem
plates/scaffolds/new.rhtml where line #4 raised undefined method `company
name_before_type_cast'' for #<Registration:0x3c7fb3c4>
1: <h1>New <%= @scaffold_singular_name %></h1>
2:
3: <%= error_messages_for(@scaffold_singular_name) %>
4: <%= form(@scaffold_singular_name, :action => "create" +
@scaffold_suffix)
%>
5:
6: <%= link_to "Back", :action =>
"list#{@scaffold_suffix}" %>
Show template trace
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.8.0/lib/active_record/base.
rb:1136:in `method_missing''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_view/helpers/f
orm_helper.rb:242:in `send''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_view/helpers/f
orm_helper.rb:242:in `value_before_type_cast''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_view/helpers/f
orm_helper.rb:167:in `to_input_field_tag''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_view/helpers/a
ctive_record_helper.rb:129:in `to_tag''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_view/helpers/a
ctive_record_helper.rb:21:in `input''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_view/helpers/a
ctive_record_helper.rb:120:in `default_input_block''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_view/helpers/a
ctive_record_helper.rb:120:in `call''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_view/helpers/a
ctive_record_helper.rb:116:in `all_input_tags''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_view/helpers/a
ctive_record_helper.rb:116:in `collect''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_view/helpers/a
ctive_record_helper.rb:116:in `all_input_tags''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_view/helpers/a
ctive_record_helper.rb:70:in `form''
(erb):4:in `evaluate_locals''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_view/base.rb:2
65:in `evaluate_locals''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_view/base.rb:2
75:in `rhtml_render''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_view/base.rb:2
01:in `send''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_view/base.rb:2
01:in `render_template''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_view/base.rb:1
81:in `render_file''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/sca
ffolding.rb:157:in `render_scaffold''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/sca
ffolding.rb:117:in `new''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/bas
e.rb:678:in `send''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/bas
e.rb:678:in `perform_action_without_filters''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/fil
ters.rb:294:in `perform_action_without_benchmark''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/ben
chmarking.rb:30:in `perform_action_without_rescue''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/ben
chmarking.rb:30:in `measure''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/ben
chmarking.rb:30:in `perform_action_without_rescue''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/res
cue.rb:79:in `perform_action''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/bas
e.rb:320:in `send''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/bas
e.rb:320:in `process''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/action_controller/bas
e.rb:263:in `process''
/usr/local/lib/ruby/gems/1.8/gems/rails-0.10.1/lib/dispatcher.rb:32:in
`dispatch''
/var/www/htdocs/registration/public/dispatch.cgi:10
Request
Parameters: {"registration/new.html/new"=>nil}
Show session dump
--- {}Response
Headers: {"cookie"=>[],
"Cache-Control"=>"no-cache"}
Show template parameters
{"registration"=>#<Registration:0x3c7fb3c4 @new_record=true,
@errors=#<ActiveRecord::Errors:0x3c7bf3c4 @base=#<Registration:0x3c7fb3c4
...>, @errors={}>, @attributes={"created_on"=>nil,
"title"=>nil,
"email_work"=>nil, "email_home"=>nil,
"company_address_city"=>nil,
"updated_on"=>nil, "company name"=>nil,
"company_address_state"=>nil,
"company_address_street"=>nil, "phone_work"=>nil,
"description"=>nil,
"first_name"=>nil, "last_name"=>nil,
"email_opt_out"=>nil,
"company_address_postalcode"=>nil,
"company_address_country"=>nil}>,
"rescues_path"=>"/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.5.1/lib/acti
on_controller/templates/rescues/",
"scaffold_suffix"=>"",
"scaffold_class"=>Registration,
"scaffold_plural_name"=>"registrations",
"action_methods"=>["update", "destroy",
"create", "show", "new", "edit",
"index", "wsdl", "list"],
"flash"=>{},
"scaffold_singular_name"=>"registration"}