advice two almost identical controllers

you could try some routing. add to routes.rb before the last two automatically generated routes

map.invoices_in 'in/invoices/:action/:id',   :controller => 'invoices', :type => 'in' map.invoices_out 'out/invoices/:action/:id',   :controller => 'invoices', :type => 'out'

so now if you do


in your invoices controller:

def show   if params[:type]=='in'      # handle incoming invoices   else      # handle outgoing invoices   end end

in your view, you can use the named route

<%= link_to 'incoming invoice #1', invoices_in_path( :action=>'show',:id => 1) %>

and it will generate

<a href="in/invoices/show/1">incoming invoice #1</a>

invoices_in_path and invoices_in_url methods are automatically created for you because of his

map.invoices_in 'in/invoices/:action/:id',....