Hi Nick,- thanks for your comment, I appreciate it. I've worked around the problem but it is definitely helpful. Previously I thought that pluralization patterns in the routes file must follow those of the controllers but now I can see it's not the case - the two things are decoupled and the most important thing is the proper pluralization of the controllers.
All the best, Vahagn Nick Hoffman wrote: > On Nov 4, 8:08�am, Vahagn Hayrapetyan <[EMAIL PROTECTED] > s.net> wrote: >> has one house. >> >> /V. > > Hi Vahagn. Resources don't have to be plural. For example, one of my > apps has users, and when they login, they access their account at this > path: > /account/ > To do this, I added the following to routes.rb: > map.resource :account > You just need to make sure that all of your files and classes have > proper pluralisation. Thus, I have AccountsController. > > For your question, I would think that you'd need: > # config/routes.rb > map.resources :users do |users| > users.resource :house, :controller => 'user_house' > end > > # app/controllers/houses_controller.rb > class HousesController < ApplicationController > > In other words, make sure it's "HousesController" and > "houses_controller.rb" (plural), not "HouseController" or > "house_controller.rb" (singular). > > Once you have that working properly, you can generate URLs and paths > to a user's house like this: > user_house_path > user_house_url > > I hope that helps, > Nick -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

