module Wice

Public Class Methods

define_routes(map, controller) click to toggle source

Used in routes.rb to define routes to the query processing controller. Parameters:

  • map - the mapper object used in routes.rb to defined routes (instance of ActionController::Routing::RouteSet::Mapper)

  • controller - name of the query processing controller, i.e. 'queries' if the controller is QueriesController .

Read section “Saving Queries How-To” in README for more details.

# File lib/wice/wice_grid_serialized_queries_controller.rb, line 8
def define_routes(map, controller)
  controller = controller.to_s

  map.match '/wice_grid_serialized_queries/:grid_name',
    :to => "#{controller}#create",
    :as => 'create_serialized_query'

  map.match '/wice_grid_serialized_queries/:grid_name/:id',
    :to => "#{controller}#delete",
    :as => 'delete_serialized_query'
end