Sha256: e57cf13f62ba2422f03c762bc0a7d7e281840054dc6c6325dc227f8b4ce9a40c

Contents?: true

Size: 995 Bytes

Versions: 9

Compression:

Stored size: 995 Bytes

Contents

# wrap the action rendering for ActiveScaffold controllers
module ActionController #:nodoc:
  class Base
    def render_with_active_scaffold(*args, &block)
      if self.class.uses_active_scaffold? and params[:adapter] and @rendering_adapter.nil? and 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.blank? ? Hash.new : args.first
        render :partial => params[:adapter][1..-1],
        :locals => {:payload => render_to_string(opts.merge(:layout => false), &block).html_safe},
               :use_full_path => true, :layout => false, :content_type => :html
        @rendering_adapter = nil # recursion control
      else
        render_without_active_scaffold(*args, &block)
      end
    end
    alias_method_chain :render, :active_scaffold

    # Rails 2.x implementation is post-initialization on :active_scaffold method
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
active_scaffold-3.2.12 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.2.11 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.2.10 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.2.9 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.2.8 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.2.7 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.2.6 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.2.5 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.2.4 lib/active_scaffold/extensions/action_controller_rendering.rb