-
Notifications
You must be signed in to change notification settings - Fork 0
/
business_extension.rb
44 lines (38 loc) · 1.73 KB
/
business_extension.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Uncomment this if you reference any of your controllers in activate
# require_dependency 'application'
class BusinessExtension < Radiant::Extension
version "1.0"
description "Business Extension"
url "http://rubidine.com"
define_routes do |map|
map.resources :businesses, :path_prefix => "/admin"
map.resources :categories, :path_prefix => "/admin"
map.resources :events, :path_prefix => "/admin"
map.resources :tags, :path_prefix => "/admin"
map.resources :additional_locations, :path_prefix => "/admin"
map.with_options(:controller => 'businesses') do |business|
#business.add_location "/admin/businesses/:id/new_location", :action => 'new_location'
end
map.resources :businesses
map.resources :additional_locations
#map.namespace :businesses do |businesses|
# businesses.resources( :member => { :add_location => :post } )
#end
map.connect 'businesses/:action/:id', :controller=>'businesses'
map.connect 'additional_locations/:action/:id', :controller=>'additional_locations'
# map.connect 'admin/business_extension/:action', :controller => 'admin/business_extension'
end
def activate
Page.send :include, BusinessTags
Page.send :include, EventTags
Page.send :include, CategoryTags
Page.send :include, LabelTags
Page.send :include, AdditionalLocationTags
admin.tabs.add "Businesses", "/admin/businesses", :after => "Layouts", :visibility => [:all]
admin.tabs.add "Events", "/admin/events", :after => "Layouts", :visibility => [:all]
admin.tabs.add "Categories/Labels", "/admin/categories", :after => "Layouts", :visibility => [:all]
end
def deactivate
# admin.tabs.remove "Business Extension"
end
end