lib/active_scaffold/extensions/action_view_rendering.rb
#
# Adds two rendering options.
#
# ==render :super
#
# This syntax skips all template overrides and goes directly to the provided ActiveScaffold templates.
# Useful if you want to wrap an existing template. Just call super!
#
# ==render :active_scaffold => #{controller.to_s}, options = {}+
#
# Lets you embed an ActiveScaffold by referencing the controller where it's configured.
#
# You may specify options[:constraints] for the embedded scaffold. These constraints have three effects:
#   * the scaffold's only displays records matching the constraint
#   * all new records created will be assigned the constrained values
#   * constrained columns will be hidden (they're pretty boring at this point)
#
# You may also specify options[:conditions] for the embedded scaffold. These only do 1/3 of what
# constraints do (they only limit search results). Any format accepted by ActiveRecord::Base.find is valid.
#
# Defining options[:label] lets you completely customize the list title for the embedded scaffold.
#
# options[:xhr] force to load embedded scaffold with AJAX even when render_component gem is installed.
#
Adds two rendering options.
render :super

This syntax skips all template overrides and goes directly to the provided ActiveScaffold templates.
Useful if you want to wrap an existing template. Just call super!

render :active_scaffold => #{controller.to_s}, options = {}+

Lets you embed an ActiveScaffold by referencing the controller where it's configured.

You may specify options[:constraints] for the embedded scaffold. These constraints have three effects:
the scaffold's only displays records matching the constraint
all new records created will be assigned the constrained values
constrained columns will be hidden (they're pretty boring at this point)

You may also specify options[:conditions] for the embedded scaffold. These only do 1/3 of what
constraints do (they only limit search results). Any format accepted by ActiveRecord::Base.find is valid.

Defining options[:label] lets you completely customize the list title for the embedded scaffold.

options[:xhr] force to load embedded scaffold with AJAX even when render_component gem is installed.
Adds two rendering options . render : super This syntax skips all template overrides and goes directly to the provided ActiveScaffold templates . Useful if you want to wrap an existing template . Just call super! render : active_scaffold = > # { controller . to_s } options = {} + Lets you embed an ActiveScaffold by referencing the controller where it ' s configured . You may specify options [ : constraints ] for the embedded scaffold . These constraints have three effects : the scaffold ' s only displays records matching the constraint all new records created will be assigned the constrained values constrained columns will be hidden ( they ' re pretty boring at this point ) You may also specify options [ : conditions ] for the embedded scaffold . These only do 1 / 3 of what constraints do ( they only limit search results ) . Any format accepted by ActiveRecord :: Base . find is valid . Defining options [ : label ] lets you completely customize the list title for the embedded scaffold . options [ : xhr ] force to load embedded scaffold with AJAX even when render_component gem is installed .
def update_view_paths
      last_view_path =
        if @lookup_context 
          File.expand_path(File.dirname(File.dirname(@lookup_context.last_template.short_identifier.to_s)), Rails.root)
        else
          File.expand_path(File.dirname(File.dirname(lookup_context.last_template.inspect)), Rails.root)
        end
      new_view_paths = view_paths.drop(view_paths.find_index { |path| path.to_s == last_view_path } + 1)
      if @lookup_context 
        if respond_to? :build_lookup_context .0
          build_lookup_context(new_view_paths)
        else .1
          @lookup_context = ActionView::LookupContext.new(new_view_paths)
        end
      else
        lookup_context.view_paths = new_view_paths
      end
    end
def update_view_paths last_view_path = if @lookup_context File . expand_path ( File . dirname ( File . dirname ( @lookup_context . last_template . short_identifier . to_s ) ) , Rails . root ) else File . expand_path ( File . dirname ( File . dirname ( lookup_context . last_template . inspect ) ) , Rails . root ) end new_view_paths = view_paths . drop ( view_paths . find_index { | path | path . to_s == last_view_path } + 1 ) if @lookup_context if respond_to? :build_lookup_context build_lookup_context ( new_view_paths ) else @lookup_context = ActionView :: LookupContext . new ( new_view_paths ) end else lookup_context . view_paths = new_view_paths end end
Adds two rendering options.
Adds two rendering options .
# rails 6 # rails 6 # rails 6.0 # rails 6.1