views:

27

answers:

2

map.resources :persons

map.resources :people

class Persons_controller < ApplicationController::Base
  #the whole logic for the controller
end

class People_controller < PersonsController
  #nothing special there
end

How I can use the views from /app/views/persons/ when I access my app from http://mydomain.com/people/1 ?

I get an error about missing people/show.erb view , I don't want use any symlinks

A: 

http://api.rubyonrails.org/classes/ActionView/Partials.html

In your views i'd suggest creating a shared folder to store shared views.

/views/shared
/views/shared/_people.html.haml

Then you can do something like where you want to use that partial.

render :partial => "shared/people"

You still need to create the action views in each directory but just render the shared partial instead.

David Lyod
thanks, but I want to stay with the default directory
astropanic
A: 

I think the right thing to do is follow David Lyod's advice. It's much better organization and you always know where your shared files are. However, you can still use the same concept by placing the partial _people.html.erb in the views/persons directory. Then in the people view file that uses it

render :partial => "persons/people"

Hope this helps.

Warren