Re: path helper help

Fernando Almeida
Thu, 20 Sep 2012 01:56:59 -0000

Use "collection" instead "member"
http://guides.rubyonrails.org/routing.html#adding-more-restful-actions

2012/9/19 S Ahmed <sahmed1020-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

> I have a controller:
>
> class HomeController < ApplicationController
>   def index
>
>   end
>
>   def about
>   end
>
>   def contact
>   end
>
>   def terms
>   end
>
>   def privacy
>   end
> end
>
> My routes.rb has:
>
>  resources :home do
>     member do
>       get ''about''
>       get ''contact''
>       get ''terms''
>       get ''privacy''
>     end
>   end
>
>
> In my application.html.erb I have:
>
> <a href="<%= about_home_path
%>">About
>
> It seems to be expecting an id?
>
> I''m getting the error:
>
>
> No route matches {:action=>"about",
:controller=>"home"}
>
>
> Rake routes shows:
>
> about_home GET    /home/:id/about(.:format)   home#about
>
>  --
> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



--
Fernando Almeida