Adding rows to table in database through forms

I posted a question on stackoverflow:

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.

I posted a question on stackoverflow:

ruby on rails - adding row to table through form - Stack Overflow

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