I have a User model and an About model. An example model is a page on which users have more information about them, since its nature is more appropriate for its use on a separate model, and not in the user model.
I want to be able to direct it to something like /: username / about and get all the verbs working in this way (GET POST, PUT, DELETE).
/:username/about
/:username/about/edit
/:username/about
This is what I already have
resources :users do
resources :abouts
end
match ':username/about' => 'abouts#show', :as => :user_about
match ':username/about/add' => 'abouts#new', :as => :user_new_about
match ':username/about/edit' => 'abouts#edit', :as => :user_edit_about
And in the models I
# about.rb
belongs_to :user
# user.rb
has_one :about
When I make a message or put in / roses / about It interprets it as a show
Started POST "/roses/about" for 127.0.0.1 at Sun Feb 27 16:24:18 -0200 2011
Processing by AboutsController
I probably miss the declaration in the routes, but isnβt it confused by declaring every verb for the resource when it differs from the standard?
What is the easiest and cleanest way to archive this?