Sha256: 1e5817ce65c61674c672a86137ae79866a8a3bfff3f4495bf7f275902f2e852f

Contents?: true

Size: 954 Bytes

Versions: 11

Compression:

Stored size: 954 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?
        @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
        @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

11 entries across 11 versions & 2 rubygems

Version Path
active_scaffold_vho-3.1.1 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.1.10 lib/active_scaffold/extensions/action_controller_rendering.rb~
active_scaffold-3.1.9 lib/active_scaffold/extensions/action_controller_rendering.rb~
active_scaffold-3.1.8 lib/active_scaffold/extensions/action_controller_rendering.rb~
active_scaffold_vho-3.1.0 lib/active_scaffold/extensions/action_controller_rendering.rb
active_scaffold-3.1.7 lib/active_scaffold/extensions/action_controller_rendering.rb~
active_scaffold-3.1.6 lib/active_scaffold/extensions/action_controller_rendering.rb~
active_scaffold-3.1.5 lib/active_scaffold/extensions/action_controller_rendering.rb~
active_scaffold-3.0.24 lib/active_scaffold/extensions/action_controller_rendering.rb~
active_scaffold-3.1.4 lib/active_scaffold/extensions/action_controller_rendering.rb~
active_scaffold-3.1.3 lib/active_scaffold/extensions/action_controller_rendering.rb~