Module: Mjs
- Defined in:
- lib/mjs/merb.rb,
lib/mjs.rb,
lib/mjs/utils.rb,
lib/mjs/helper.rb,
lib/mjs/sinatra.rb,
lib/mjs/page_object.rb,
lib/mjs/java_script_context.rb
Overview
This file is almost derived from prototype_helper.rb of RoR
Defined Under Namespace
Modules: Helper, PageObject, Utils Classes: Application, JavaScriptContext, JavaScriptElementProxy, JavaScriptProxy, JavaScriptVariableProxy, Main
Class Method Summary collapse
-
.activate ⇒ Object
Activation hook - runs after AfterAppLoads BootLoader.
-
.deactivate ⇒ Object
Deactivation hook - triggered by Merb::Slices.deactivate(Mjs).
-
.init ⇒ Object
Initialization hook - runs before AfterAppLoads BootLoader.
-
.loaded ⇒ Object
Stub classes loaded hook - runs before LoadClasses BootLoader right after a slice’s classes have been loaded internally.
-
.setup_router(scope) ⇒ Object
Setup routes inside the host application.
Class Method Details
.activate ⇒ Object
Activation hook - runs after AfterAppLoads BootLoader
40 41 |
# File 'lib/mjs/merb.rb', line 40 def self.activate end |
.deactivate ⇒ Object
Deactivation hook - triggered by Merb::Slices.deactivate(Mjs)
44 45 |
# File 'lib/mjs/merb.rb', line 44 def self.deactivate end |
.init ⇒ Object
Initialization hook - runs before AfterAppLoads BootLoader
35 36 37 |
# File 'lib/mjs/merb.rb', line 35 def self.init Merb::Controller.send(:include, ::Mjs::Helper) end |
.loaded ⇒ Object
Stub classes loaded hook - runs before LoadClasses BootLoader right after a slice’s classes have been loaded internally.
30 31 32 |
# File 'lib/mjs/merb.rb', line 30 def self.loaded require 'mjs/helper' end |
.setup_router(scope) ⇒ Object
prefix your named routes with :mjs_ to avoid potential conflicts with global named routes.
Setup routes inside the host application
56 57 58 59 60 61 62 63 |
# File 'lib/mjs/merb.rb', line 56 def self.setup_router(scope) # example of a named route scope.match('/index(.:format)').to(:controller => 'main', :action => 'index').name(:index) # the slice is mounted at /mjs - note that it comes before default_routes scope.match('/').to(:controller => 'main', :action => 'index').name(:home) # enable slice-level default routes by default scope.default_routes end |