Sha256: dbddcd329fb1430a60231b3360d361d940913f2daa29094fdd71586f5eda9821

Contents?: true

Size: 955 Bytes

Versions: 29

Compression:

Stored size: 955 Bytes

Contents

# wrap the action rendering for ActiveScaffold controllers
module ActiveScaffold
  module ActionController #:nodoc:
    def render(*args, &block)
      if self.class.uses_active_scaffold? && params[:adapter] && @rendering_adapter.nil? && request.xhr?
        @rendering_adapter = true # recursion control
        # if we need an adapter, then we render the actual stuff to a string and insert it into the adapter template
        opts = args.any? ? args.first : {}

        render :partial => params[:adapter][1..-1],
               :locals => {:payload => render_to_string(opts.merge(:layout => false), &block).html_safe}, # rubocop:disable Rails/OutputSafety
               :use_full_path => true, :layout => false, :content_type => :html
        @rendering_adapter = nil # recursion control
      else
        super(*args, &block)
      end
    end
  end
end

module ActionController
  class Base
    prepend ActiveScaffold::ActionController
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
active_scaffold-3.7.8 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.7.7 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.7.6 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.7.5 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.7.2 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.7.1 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.7.0 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.6.20 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.6.19 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.6.17 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.6.15 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.6.14 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.6.13 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.6.12 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.6.11.1 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.6.11 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.6.10 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.6.9 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.6.8 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.6.6 lib/active_scaffold/extensions/action_controller_rendering.rb