i'm using devise authenticate users , getting following error @ registration , sign in pages
no route matches {:action=>"search", :controller=>"devise/home"}
apparently it's caused by
<%= link_to "search", url_for(:controller => "home", :action => "search")
in layouts/application.html.erb
the setup absolutely basic, here's routes.rb:
get "home/search" devise_for :users root :to => "home#index"
from http://api.rubyonrails.org/classes/actionview/helpers/urlhelper.html#method-i-link_to:
be careful when using older argument style, literal hash needed:
link_to "articles", { :controller => "articles" }, :id => "news", :class => "article" # => <a href="/articles" class="article" id="news">articles</a>
leaving hash off gives wrong link:
link_to "wrong!", :controller => "articles", :id => "news", :class => "article" # => <a href="/articles/index/news?class=article">wrong!</a>
it considered "preferable" use named resource routes described in link above if resource routes change, don't have manually update links.
Comments
Post a Comment