Maybe it could be a inflection problem:

"home".pluralize
"homes"

The convention is that a controller is the pluralized name of the model.
On Wed, Sep 19, 2012 at 10:32 PM, S Ahmed wrote:

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:

<li><a href="<%= about_home_path %>">About</a></li>

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@googlegroups.com.
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 9 | next ›
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedSep 20, '12 at 1:33a
activeSep 20, '12 at 2:59a
posts9
users4
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2021 Grokbase