Module: Ramaze::Helper::Methods
- Included in:
- Amrita2::Template, Ezamar::Element, Controller, Template::Markaby, Template::Template, Tenjin::Context
- Defined in:
- lib/ramaze/helper.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#helper(*syms) ⇒ Object
This loads the helper-files from /ramaze/helper/helpername.rb and includes it into Ramaze::Template (or wherever it is called).
Class Method Details
.extend_object(other) ⇒ Object
28 29 30 31 |
# File 'lib/ramaze/helper.rb', line 28 def self.extend_object other other.send :extend, Trinity super end |
.included(other) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/ramaze/helper.rb', line 21 def self.included other other.send :extend, Trinity other.send :extend, Methods other.send :include, Trinity super end |
Instance Method Details
#helper(*syms) ⇒ Object
This loads the helper-files from /ramaze/helper/helpername.rb and includes it into Ramaze::Template (or wherever it is called)
Usage:
helper :redirect, :link
39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/ramaze/helper.rb', line 39 def helper(*syms) syms.each do |sym| name = sym.to_s if mod = find_helper(name) use_helper(mod) else if require_helper(name) redo else raise LoadError, "helper #{name} not found" end end end end |