lib/active_scaffold/helpers/controller_helpers.rb
# Parameters to generate url to the main page (override if the ActiveScaffold is used as a component on another controllers page)
Parameters to generate url to the main page (override if the ActiveScaffold is used as a component on another controllers page)
Parameters to generate url to the main page ( override if the ActiveScaffold is used as a component on another controllers page )
def main_path_to_return
        if params[:return_to]
          params[:return_to]
        else
          exclude_parameters = %i[utf8 associated_id]
          parameters = {}
          if params[:parent_scaffold] && nested_singular_association?
            parameters[:controller] = params[:parent_scaffold]
            exclude_parameters.concat [nested.param_name, :association, :parent_scaffold]
          end
          parameters.merge! nested.to_params if nested?
          if params[:parent_sti]
            parameters[:controller] = params[:parent_sti]
          end
          parameters[:action] = 'index'
          parameters[:id] = nil
          params_for(parameters).except(*exclude_parameters)
        end
      end
def main_path_to_return if params [ :return_to ] params [ :return_to ] else exclude_parameters = %i[ utf8 associated_id ] parameters = { } if params [ :parent_scaffold ] && nested_singular_association? parameters [ :controller ] = params [ :parent_scaffold ] exclude_parameters . concat [ nested . param_name , :association , :parent_scaffold ] end parameters . merge! nested . to_params if nested? if params [ :parent_sti ] parameters [ :controller ] = params [ :parent_sti ] end parameters [ :action ] = 'index' parameters [ :id ] = nil params_for ( parameters ) . except ( * exclude_parameters ) end end
Parameters to generate url to the main page (override if the ActiveScaffold is used as a component on another controllers page)
Parameters to generate url to the main page ( override if the ActiveScaffold is used as a component on another controllers page )
# parameters[:eid] = params[:parent_scaffold] # not neeeded anymore? # parameters[:eid] = nil # not neeeded anymore?