开发者

How do I set up a named route in rails 3?

This is a month long thing I've been putting off, and I can't for the life of me figure this bugger out.

I'm tracking to access a file in website/admin/organizations/org_deals

My routes look like this :

map.namespace :admin do |admin|
  admin.namespace :organizations do |organization|
    organization.org_deals 'org_deals', :action =&开发者_如何学Gogt; 'org_deals'
  end
end

rake routes | grep org_deals :

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

I made my link look like this

admin_organizations_org_deals_path

I mouse over the link I get http://localhost:3000/admin/organizations/org_deals

I click on it, and I get :

No such file or directory - /Users/daniellevine/Sites/hq_channel/app/views/admin/organizations/show.html.haml

WTF? :D


I had some trouble with routes just a few days ago when i upgraded to rails 3, i can't tell you bout namespaces cuz i didn't used it yet, but this guide was very helpful to me, there's a topic on namespaces, hope it helps: http://edgeguides.rubyonrails.org/routing.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜