Hello,
I am trying to pass the argument in form_tag but having some issue.
This is what I have
index.rhtml
<%= form_tag :action => “process_login”%>
User name: <%= text_field “user”, “username” %>
Password: <%= password_field “user”, “password” %>
<%= submit_tag ‘Log In’ %>
<%= end_form_tag %>
Now, how do I see the username and password in controller. this is my
process_login looks like
controller.rb
def login
@user = User.new
@user.username = params[:username]
end
def process_login
redirect_to :action => ‘login’, :username => params[:user][:username]
end
I get following error
uninitialized constant Chapter2Controller::User
Thank you