Module: MerbAdmin

Defined in:
lib/merb-admin.rb,
lib/abstract_model.rb,
lib/generic_support.rb,
lib/datamapper_support.rb,
lib/merb-admin/version.rb,
lib/active_record_support.rb,
lib/sequel_support.rb

Overview

All Slice code is expected to be namespaced inside a module

Defined Under Namespace

Classes: AbstractModel, Application, Main

Constant Summary collapse

VERSION =
"0.8.8"

Class Method Summary collapse

Class Method Details

.activateObject

Activation hook - runs after AfterAppLoads BootLoader



39
40
# File 'lib/merb-admin.rb', line 39

def self.activate
end

.deactivateObject

Deactivation hook - triggered by Merb::Slices.deactivate(MerbAdmin)



43
44
# File 'lib/merb-admin.rb', line 43

def self.deactivate
end

.initObject

Initialization hook - runs before AfterAppLoads BootLoader



35
36
# File 'lib/merb-admin.rb', line 35

def self.init
end

.loadedObject

Stub classes loaded hook - runs before LoadClasses BootLoader right after a slice’s classes have been loaded internally.



31
32
# File 'lib/merb-admin.rb', line 31

def self.loaded
end

.setup_router(scope) ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/merb-admin.rb', line 46

def self.setup_router(scope)
  scope.match("/", :method => :get).
    to(:controller => "main", :action => "index").
    name(:dashboard)

  scope.match("/:model_name", :method => :get).
    to(:controller => "main", :action => "list").
    name(:list)

  scope.match("/:model_name/new", :method => :get).
    to(:controller => "main", :action => "new").
    name(:new)

  scope.match("/:model_name/:id/edit", :method => :get).
    to(:controller => "main", :action => "edit").
    name(:edit)

  scope.match("/:model_name", :method => :post).
    to(:controller => "main", :action => "create").
    name(:create)

  scope.match("/:model_name/:id", :method => :put).
    to(:controller => "main", :action => "update").
    name(:update)

  scope.match("/:model_name/:id/delete", :method => :get).
    to(:controller => "main", :action => "delete").
    name(:delete)

  scope.match("/:model_name/:id(.:format)", :method => :delete).
    to(:controller => "main", :action => "destroy").
    name(:destroy)
end