Hi all,
I have these models
Account has_many :taxes
Tax belongs_to :account
And the tax resource is nested inside the account resource like so
map.resources :accounts do |account|
account.resources :taxes, :name_prefix => nil
....#more resources here
end
Now when I rake the routes for Tax using rake routes|grep Tax in
Terminal, these are the named routes
taxes GET /accounts/:account_id/
taxes {:controller=>"taxes",
:action=>"index"}
formatted_taxes GET /accounts/:account_id/taxes.:format
{:controller=>"taxes", :action=>"index"}
POST /accounts/:account_id/
taxes {:controller=>"taxes",
:action=>"create"}
POST /accounts/:account_id/
taxes.:format {:controller=>"taxes",
:action=>"create"}
new_taxis GET /accounts/:account_id/taxes/new
{:controller=>"taxes", :action=>"new"}
formatted_new_taxis GET /accounts/:account_id/taxes/new.:format
{:controller=>"taxes", :action=>"new"}
edit_taxis GET /accounts/:account_id/taxes/:id/
edit {:controller=>"taxes",
:action=>"edit"}
formatted_edit_taxis GET /accounts/:account_id/taxes/:id/
edit.:format {:controller=>"taxes", :action=>"edit"}
taxis GET /accounts/:account_id/
taxes/:id {:controller=>"taxes",
:action=>"show"}
formatted_taxis GET /accounts/:account_id/
taxes/:id.:format {:controller=>"taxes",
:action=>"show"}
PUT /accounts/:account_id/
taxes/:id {:controller=>"taxes",
:action=>"update"}
PUT /accounts/:account_id/
taxes/:id.:format {:controller=>"taxes",
:action=>"update"}
DELETE /accounts/:account_id/
taxes/:id {:controller=>"taxes",
:action=>"destroy"}
DELETE /accounts/:account_id/
taxes/:id.:format {:controller=>"taxes",
:action=>"destroy"}
You can see that the ''edit'' and ''new'' routes
which are for a single
record of the Tax model are generated as ''new_taxis'' and
''edit_taxis"
path for some reason instead of ''new_tax'' and
''edit_tax'' . I simply
used these routes instead but now im getting other errors. For eg.,
when i try to do current_account.taxes, i get the following error
"uninitialized constant Account::Taxis"
I cant make out what the problem is and how it came up. Hoping someone
can help me find a solution.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---