Ruby on Rails Sunday, November 30, 2014

On 30 November 2014 at 09:56, bradford li <bradfordli@gmail.com> wrote:
> I posted a question on stackoverflow:
>
> http://stackoverflow.com/questions/27211929/adding-row-to-table-through-form
>
> I am getting an error trying to add rows to my table when I click submit on
> my form. I am not sure where I am going wrong.

The error shown is

NoMethodError (undefined method `[]' for nil:NilClass):
app/controllers/users_controller.rb:32:in `create'

That tells you that you have an object that you something like
variable[..] but the variable is nil. It tells you which line the
problem is on. You need to debug your code to find why that variable
is nil. Often the log in log/development.log can be useful. For very
simple debugging you can insert code such as
puts myvariable.inspect
in, for example, the controller, and that will show the variable in
the server terminal window.

Colin



>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/75782964-5e77-4e82-9ec9-837ac9cebaa2%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLv_DgNLCeAxxJN18QY1f38ka3VtxMSOubZ0D78z3jWpoA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment