You should define it as

:on => :collection

Problem is you defined it as :member, so it expects an id to be
passed, so the expected url would look like /home/:id/login

Hope this helps!

On 29 feb, 15:14, amvis <vgrkrish...@gmail.com> wrote:
> Here i am using *rails3*, here the view.html.erb form have one login
> button, so when i click on that button, gives no routes matches :controller
> => 'home', :action => 'login'. But i have put that in routes.rb. Why this
> happening?
>
> *view.html.erb*
>
> <%= form_tag( { :controller => 'home', :action => 'login' }, { :method => 
> 'post'}) do %>
> <%= text_field(:name, :name, :class => "span2",:placeholder => "Username") %>
> <%= password_field_tag(:password, :password,  :class =>"span2") %>
> <%= submit_tag "Login", :class => "btn btn-primary" %>
> <% end %>
> routes.rb
>
>  resources :home do
>    post :login, :on => :member
> end
>
> homecontroller.rb
>
> class HomeController < ApplicationController
> def login
>
>  end
> end

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to