lib/active_admin/resource/routes.rb in activeadmin-1.0.0.pre5 vs lib/active_admin/resource/routes.rb in activeadmin-1.0.0
- old
+ new
@@ -23,11 +23,11 @@
route_builder.edit_instance_path(resource, additional_params)
end
# Returns the routes prefix for this config
def route_prefix
- namespace.module_name.try(:underscore)
+ namespace.route_prefix
end
def route_builder
@route_builder ||= RouteBuilder.new(self)
end
@@ -60,11 +60,10 @@
action: :batch_action,
suffix: (resource.route_uncountable? ? "index_path" : "path")
)
query = params.slice(:q, :scope)
- query = query.permit! if query.respond_to? :permit!
- query = query.to_h if Rails::VERSION::MAJOR >= 5
+ query = query.permit!.to_h
routes.public_send route_name, *route_collection_params(params), additional_params.merge(query)
end
# @return [String] the path to this resource collection page
# @param instance [ActiveRecord::Base] the instance we want the path of