Module: RespondForHelper::Controller
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/respond_for_helper/controller.rb
Instance Method Summary collapse
Instance Method Details
#respond_for(item, options = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/respond_for_helper/controller.rb', line 7 def respond_for(item, = {}) respond = Respond.new(self, item, ) respond_to do |format| yield(format, respond) if block_given? respond.formatters.each do |formatter| format.send(formatter.format) { formatter.call } end respond.run_before_callbacks end respond.run_after_callbacks end |