Class: Merb::Controller
- Inherits:
-
Object
- Object
- Merb::Controller
- Defined in:
- lib/merb_component/controller_ext.rb
Defined Under Namespace
Classes: Aggregator
Constant Summary collapse
- METHOD_TO_ACTION =
{ :post => :create, :put => :update, :delete => :destroy }.freeze
Instance Method Summary collapse
- #_abstract_dispatch(*args) ⇒ Object
- #aggregator ⇒ Object
- #url_with_scope(*args) ⇒ Object (also: #url)
Instance Method Details
#_abstract_dispatch(*args) ⇒ Object
135 136 137 138 |
# File 'lib/merb_component/controller_ext.rb', line 135 def _abstract_dispatch(*args) _dispatch = Merb::AbstractController.instance_method(:_dispatch) _dispatch.bind(self).call(*args) end |
#aggregator ⇒ Object
140 141 142 143 |
# File 'lib/merb_component/controller_ext.rb', line 140 def aggregator aggregators = Thread::current[:aggregators] ||= {} (aggregators[self.class] ||= []).last end |
#url_with_scope(*args) ⇒ Object Also known as: url
145 146 147 148 149 150 151 152 |
# File 'lib/merb_component/controller_ext.rb', line 145 def url_with_scope(*args) result = url_without_scope(*args) if (agg = aggregator) && (key = agg.key) resource_without_scope(key) + result else result end end |