Skip to content

Instantly share code, notes, and snippets.

@bishopandco
Created October 14, 2010 02:10
Show Gist options
  • Save bishopandco/625417 to your computer and use it in GitHub Desktop.
Save bishopandco/625417 to your computer and use it in GitHub Desktop.
map.namespace :admin do |admin|
admin.resources :news, :collection => {:post_data => :post, :sort => :post, :search => :post}
end
$ rake routes | grep news
search_admin_news POST /admin/news/search(.:format) {:controller=>"admin/news", :action=>"search"}
post_data_admin_news POST /admin/news/post_data(.:format) {:controller=>"admin/news", :action=>"post_data"}
sort_admin_news POST /admin/news/sort(.:format) {:controller=>"admin/news", :action=>"sort"}
admin_news_index GET /admin/news(.:format) {:controller=>"admin/news", :action=>"index"}
POST /admin/news(.:format) {:controller=>"admin/news", :action=>"create"}
new_admin_news GET /admin/news/new(.:format) {:controller=>"admin/news", :action=>"new"}
edit_admin_news GET /admin/news/:id/edit(.:format) {:controller=>"admin/news", :action=>"edit"}
admin_news GET /admin/news/:id(.:format) {:controller=>"admin/news", :action=>"show"}
PUT /admin/news/:id(.:format) {:controller=>"admin/news", :action=>"update"}
DELETE /admin/news/:id(.:format) {:controller=>"admin/news", :action=>"destroy"}
admin_news_url failed to generate from {:controller=>"admin/news", :action=>"show"} - you may have ambiguous routes, or you may need to supply additional parameters for this route. content_url has the following required parameters: ["admin", "news", :id] - are they all satisfied?
@bishopandco
Copy link
Author

inflect.uncountable %w( news )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment