I got a solution from another old thread in a different forum like
map.login '/login', :controller => 'admin/user_session', :action =>
'new',
:conditions => { :method => :get }
# This line does the trick:
map.connect '/login', :controller => 'admin/user_session', :action =>
'create',
:conditions => { :method => :post }
Then in new.html.erb
<% form_for @user_session, :url => login_path do |f| %>
This is perfectly right. But if I have a route like
map.root :controller => "users",:action => "new"
And if my form is like
<% form_for @user do |f| %>