Skip to content

Instantly share code, notes, and snippets.

@coffeeaddict
Created December 17, 2010 14:37
Show Gist options
  • Save coffeeaddict/745032 to your computer and use it in GitHub Desktop.
Save coffeeaddict/745032 to your computer and use it in GitHub Desktop.
Master::Application.routes.draw do
# ... bunch of resources
# resource-less controllers
{ 'statistics' => %w(select_period filter drop_filter apply_filters
add_filter show get_filter_values
),
'warehouse' => %w(delivery delivery_with_po delivery_without_po
add_product_field shipment_csv_line shipment_put
shipment_csv
),
'finance' => %w(balance show_balance vat show_vat invoices show_invoices
stats show_stats dokter_online dokter_online_create
buckaroo buckaroo_upload
),
}.each do |controller, methods|
# match index
match "/#{controller}" => "#{controller}#index"
# match all the special methods
methods.each do |method|
match "/#{controller}/#{method}" => "#{controller}##{method}"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment