ruby - First argument in form cannot contain nil or be empty - user sign up form - rails 4 -
i'm trying create basic login/sign form in rails 4 , keep getting error "first argument in form cannot contain nil or empty" @user. part doesn't this:
<%= form_for @user |f| %>
but have 'new' method in controller, problem people seem have ask error:
class userscontroller < applicationcontroller def new @user = user.new end
can please help?
addendum: changing <%= form_for user.new do
doesn't work either...
your form looking instance of class, in case user in order (i.e. create new 1 or edit existing one). in order allow users register on index page (which wouldn't recommend - breaks restful design) need have in userscontroller
class userscontroller < applicationcontroller def new @user = user.new end def index @user = user.new end
Comments
Post a Comment