So I just started with rails a few days ago and I am wondering why this
does not work. I get an ArgumentError in User#create
Extracted source (around line #2):
1:
2: <% form.for :user, @user, :url => {:action => “create”}, :html =>
{:class => “create_form”} do |f| %>
3:
4:
5: <%= f.label :username %>
I believe this is what is relevant to what is causing the error
views/user/create.html.erb
<% form.for :user, @user, :url => {:action => “create”}, :html =>
{:class => “create_form”} do |f| %>
<%= f.label :username %>
<%= f.text_field :username %>
<%= f.label :password %>
<%= f.text_field :password %>
<%= f.label :first %>
<%= f.text_field :first %>
<%= f.label :last %>
<%= f.text_field :last %>
<%= f.label :email %>
<%= f.text_field :email %>
<%= f.submit_tag 'Sign Up' %>
<% end %>controllers/user_controller.rb
class UserController < ActionController::Base
def index
@users = User.all
end
def create
p params
@user = User.new
#@user.first = params[:user][:first]
#@user.last = params[:user][:last]
#@user.username = params[:user][:username]
#@user.password = params[:user][:password]
end
end