L
Luca Spiller
Hi all,
I am trying to setup an application that has a management section and a
client section with URLs as follows:
http://mysite.com/manage/outlines/1 - Management section with outline #1
http://mysite.com/outlines/1 - Client section with outline #1
Both refer to different controllers as follows:
app/controllers/outline_controller.rb - Management controller
app/controllers/clients/outline_controller.rb - Client controller
Yep this is a bit confusing, but this is the only controller for the
client section, where as the management section has about six.
For my routes I have the following:
map.resources
utlines, :member => { :edit2 => :get, :review => :get
},
ath_prefix => '/manage' do |outline|
outline.resources :sections, :member => { :delete => :get } do
|section|
section.resources :questions, :member => { :delete => :get } do
|question|
question.resources
ptions
end
end
end
map.resources
utlines, :controller => 'client/outlines',
:name_prefix => 'client_' do |outlines|
outlines.connect ':key', :action => 'show', :controller =>
'client/outlines'
outlines.connect ':key/:action', :controller => 'client/outlines'
end
Now onto the problem. On my local development machine in development
mode it runs perfect, but on my test machine (in production) it appears
to exhibit some sort of caching bug.
If I go to http://mysite.com/manage/outlines/1 then
http://mysite.com/outlines/1, on the second page I just see the first
page. I have tried restarting Mongrel a number of times but to no avail.
BUT if I do it the other way around, going to
http://mysite.com/outlines/1 then http://mysite.com/manage/outlines/1
everything works perfectly.
I thought maybe this was something to do with the resources having the
same name, so I changed the second block to the following:
map.with_options :controller => 'client/outlines', :name_prefix =>
'client_' do |outlines|
outlines.outline '/outlines/:id', :action => 'show', :controller =>
'client/outlines', :conditions => { :method => :get }
outlines.connect '/outlines/:id', :controller => 'client/outlines',
:action => 'update', :conditions => { :method =>
ut }
outlines.outline_with_key '/outlines/:id/:key', :action => 'show',
:controller => 'client/outlines', :conditions => { :method => :get }
outlines.connect '/outlines/:id/:key/:action', :controller =>
'client/outlines'
outlines.connect '/outlines/:id/:action', :controller =>
'client/outlines'
end
This though still exhibits exactly the same behaviour. I have tried
refreshing my browser, clearing the cache etc but no luck.
My local machine has:
OS X Tiger 10.4.11
Rails 2.1.0
Mongrel 1.1.5
My test machine has:
Ubuntu 8.04.1
Rails 2.1.0
Mongrel 1.1.5
Help please!
I am trying to setup an application that has a management section and a
client section with URLs as follows:
http://mysite.com/manage/outlines/1 - Management section with outline #1
http://mysite.com/outlines/1 - Client section with outline #1
Both refer to different controllers as follows:
app/controllers/outline_controller.rb - Management controller
app/controllers/clients/outline_controller.rb - Client controller
Yep this is a bit confusing, but this is the only controller for the
client section, where as the management section has about six.
For my routes I have the following:
map.resources
},
outline.resources :sections, :member => { :delete => :get } do
|section|
section.resources :questions, :member => { :delete => :get } do
|question|
question.resources
end
end
end
map.resources
:name_prefix => 'client_' do |outlines|
outlines.connect ':key', :action => 'show', :controller =>
'client/outlines'
outlines.connect ':key/:action', :controller => 'client/outlines'
end
Now onto the problem. On my local development machine in development
mode it runs perfect, but on my test machine (in production) it appears
to exhibit some sort of caching bug.
If I go to http://mysite.com/manage/outlines/1 then
http://mysite.com/outlines/1, on the second page I just see the first
page. I have tried restarting Mongrel a number of times but to no avail.
BUT if I do it the other way around, going to
http://mysite.com/outlines/1 then http://mysite.com/manage/outlines/1
everything works perfectly.
I thought maybe this was something to do with the resources having the
same name, so I changed the second block to the following:
map.with_options :controller => 'client/outlines', :name_prefix =>
'client_' do |outlines|
outlines.outline '/outlines/:id', :action => 'show', :controller =>
'client/outlines', :conditions => { :method => :get }
outlines.connect '/outlines/:id', :controller => 'client/outlines',
:action => 'update', :conditions => { :method =>
outlines.outline_with_key '/outlines/:id/:key', :action => 'show',
:controller => 'client/outlines', :conditions => { :method => :get }
outlines.connect '/outlines/:id/:key/:action', :controller =>
'client/outlines'
outlines.connect '/outlines/:id/:action', :controller =>
'client/outlines'
end
This though still exhibits exactly the same behaviour. I have tried
refreshing my browser, clearing the cache etc but no luck.
My local machine has:
OS X Tiger 10.4.11
Rails 2.1.0
Mongrel 1.1.5
My test machine has:
Ubuntu 8.04.1
Rails 2.1.0
Mongrel 1.1.5
Help please!