Hello Rick and thanks for answering,

I'm feeling rather muddled.  In my brief ROR history I've been working
under the assumption that naming conventions called for controllers to
be in the singular.  Of course I'm finding out that much has been
deprecated.  So  would you please confirm that controller names are
supposed to be plural.

Regarding  @responder = Responder.new(params[:responder])
Since models and tables are "routeless", I'm not clear why routing
should be an issue here.  And I thought that if the params hash is
empty, I will get an empty @responder object which is what I expect in
this case.

I appreciate any further help you can offer.

Cheers, Bill

On Sep 2, 7:11 pm, Rick <richard.t.ll...@gmail.com> wrote:
> First, I would expect to see a plural here:
>   class IncidentsController < ApplicationController
> May not seem like much but convention is important here.
>
> The :responder that appears in your line:
>   @responder = Responder.new(params[:responder])
> would typically be passed in as a field in the url that points to this
> controller/action.
>
> If you run:
>   rake routes
> you should see a line that contains something like:
>   incident GET /incidents/:responder(.:format) {:controller =>
> "incidents", :action => "show"}
> and the parameter :responder would have been explicitly set by you (or
> implicitly by link_to helper method), possibly in the file views/
> incidents/index.html.erb.
>
> On Sep 2, 7:11 pm, zambezi <b.but...@overhydration.org> wrote:
>
> > Greetings,
>
> > Can anyone shed some light on why the following error is raised?  I've
> > depleted my small inventory of ideas.
>
> > Thanks much.
>
> > Bill
>
> > --------------------
> > NoMethodError in IncidentController#signup
>
> > You have a nil object when you didn't expect it!
> > The error occurred while evaluating nil.request
>
> > RAILS_ROOT: C:/RubyRails/rails_apps/rappEAH
>
> > C:/RubyRails/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
> > action_controller/mime_responds.rb:114:in `initialize'
> > app/controllers/incident_controller.rb:19:in `new'
> > app/controllers/incident_controller.rb:19:in `signup'
> > -e:3:in `load'
> > -e:3
> > -----------------------
>
> > class IncidentController < ApplicationController
> >   def signup
> >     @title = "register"
> > #following is the offending line
> >     @responder = Responder.new(params[:responder])
>
> >   end
> > end #end class
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to