Merged
requested to merge github/fork/karlentwistle/bug/make_nested_collection_links_honour_routes into master
Created by: karlentwistle
Prior to this commit if any routes where omitted for a resource like:
resources :users
resources :orders, except: [:edit, :update]
Navigating directly to a orders show page would correctly omit the edit link but if another associated dashboard utilised a field that rendered using the partial _collection.html.erb
like:
class UserDashboard < Administrate::BaseDashboard
ATTRIBUTE_TYPES = {
orders: Field::HasMany,
}
SHOW_PAGE_ATTRIBUTES = ATTRIBUTE_TYPES.keys
end
when navigating to the users show page an error 500 would be thrown because the rendering of orders would incorrectly try to link to the non existent edit route
Fixes #790 (closed)