Module: Wee::Rails::ControllerClassMixin
- Defined in:
- lib/wee/adaptors/rails.rb
Instance Method Summary collapse
- #register_component(name, &block) ⇒ Object
- #registered_components ⇒ Object
- #scaffold_with_component(name = nil, &block) ⇒ Object
Instance Method Details
#register_component(name, &block) ⇒ Object
62 63 64 |
# File 'lib/wee/adaptors/rails.rb', line 62 def register_component(name, &block) registered_components[name] = block end |
#registered_components ⇒ Object
66 67 68 |
# File 'lib/wee/adaptors/rails.rb', line 66 def registered_components @@registered_components ||= Hash.new end |
#scaffold_with_component(name = nil, &block) ⇒ Object
70 71 72 73 74 75 76 |
# File 'lib/wee/adaptors/rails.rb', line 70 def scaffold_with_component(name=nil, &block) name ||= self.name register_component(name, &block) if block send(:define_method, :index) do show_component name end end |