module InheritedResources::ClassMethods

def custom_actions(options)


method is same as 'index' method. So you can override it if need
search_resources_{path,url} helpers. The body of generated 'search'
This macro creates 'search' method in controller and defines
custom_actions :collection => :search
* :collection - Allows you to specify collection actions.

method is same as 'show' method. So you can override it if need
delete_resource_{path,url} helpers. The body of generated 'delete'
This macro creates 'delete' method in controller and defines
custom_actions :resource => :delete
* :resource - Allows you to specify resource actions.

== Options

custom_actions :resource => [:delete, :transit], :collection => :search

Defines custom restful actions by resource or collection basis.
def custom_actions(options)
  self.resources_configuration[:self][:custom_actions] = options
  options.each do | resource_or_collection, actions |
    [*actions].each do | action |
      create_custom_action(resource_or_collection, action)
    end
  end
  create_resources_url_helpers!
  [*options[:resource]].each do | action |
    helper_method "#{action}_resource_path", "#{action}_resource_url"
  end
  [*options[:collection]].each do | action |
    helper_method "#{action}_resources_path", "#{action}_resources_url"
  end
end