0

When I go to .. www.website.com/admin/organizations/org_deals , I get :

Missing template admin/organizations/show.erb in view path

My routes.rb :

map.namespace :admin do |admin|
  admin.napespace :organizations do |organization|
    organization.org_deals 'org_deals', :action => 'org_deals', :member => {org_deals => :get}
  end
end

In my rake routes :

 admin_organizations_org_deals        
/admin/organizations/org_deals
{:controller=>"admin/organizations/", :action=>"org_deals", :member=>{:org_deals=>:get}}

And last but not least. My file is in the directory :

/admin/organizations/org_deals.html.haml

But my app desperately wants a 'show'. How can I tell it, "no, no, no, what you really want is an org_deals, silly."

Thanks!

Trip
  • 26,756
  • 46
  • 158
  • 277
  • "When I go to .. www.website.com/admin/org_deals , I get :" Did you mean "When I go to .. www.website.com/admin/organizations/org_deals"? If not, there's your problem... – Jamie Wong Jun 21 '10 at 13:45
  • Jamie Wong, sorry that was a typo. Should be the latter. I updated my post. – Trip Jun 21 '10 at 14:38
  • How about admin.namespace instead of admin.napespace? – J.R. Jun 25 '10 at 15:35
  • Either way, what does your controller look like? If your controller has a show method, then rails is GOING to want to see a show.html.erb file at some point, if you're rendering HTML from it. Are you set up to be restful? If so, named routes get trixy. – J.R. Jun 25 '10 at 15:37

1 Answers1

0

The :member key is reserved for using resources, it looks like it is expecting it as a parameter and is causing the route to not match and then to match to something else down the way. I think if you remove the :member key, it will work.

map.namespace :admin do |admin|
  admin.napespace :organizations do |organization|
    organization.org_deals 'org_deals', :action => 'org_deals'
  end
end
Geoff Lanotte
  • 7,490
  • 1
  • 38
  • 50