Well you have a namespace for hubs thats why there is no id for the
hubs
map.resources :hubs do |hub|
hub.resources :settings, :collection => { :general => :get }
end
That will give you this:
/hubs/:hub_id/settings/general
Thanks Fred...
( I was reading the most recent doc 'Rails Routing from the Outside In'
but I just started few minutes ago... )
this is fine but general should be a resource ( action will be standard
'edit') I'll have also permissions, profile and personal.. (and one
setting per hub)
so I wrote
map.resources :hubs do |hub|
hub.resource :settings do |setting|
setting.resource :general, :controller => "hub/settings/general"
end
end
this gives me :
edit_hub_settings_general GET
/hubs/:hub_id/settings/general/edit(.:format)
{:action=>"edit", :controller=>"hub/settings/general"}
which is fine...
I have a general.rb in app/controllers/hub/settings
however, when executing I get the following error :
GOT IT...
I used: class Hub::Settings::GeneralController < ApplicationController
but I did a mistake
I should use a general_controller.rb , not general.rb