[Rails] Re: help from Routing guru ...

2009-05-23 Thread Kad Kerforn


> 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 :
> 
> uninitialized constant Hub::Settings::GeneralController
> 
> how should I name my class ?
> 
> erwin

GOT IT...
I used:   class Hub::Settings::GeneralController < ApplicationController
but I did a mistake
I should use  a general_controller.rb  , not  general.rb

thanks for your tip !

-- 
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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: help from Routing guru ...

2009-05-23 Thread Kad Kerforn

Freddy Andersen wrote:
> 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 :

uninitialized constant Hub::Settings::GeneralController

how should I name my class ?

erwin



-- 
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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: help from Routing guru ...

2009-05-23 Thread Freddy Andersen

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
--~--~-~--~~~---~--~~
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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---