lib/active_scaffold/helpers/action_link_helpers.rb
# params which mustn't be copying to nested links
params which mustn't be copying to nested links
params which mustn ' t be copying to nested links
def configure_column_link(link, record, associated, actions = nil)
        actions ||= link.controller_actions || []
        if column_empty?(associated) 
          if actions.include?(:new)
            link.action = 'new'
            link.crud_type = :create
            link.label ||= :create_new
          end
        elsif actions.include?(:edit)
          link.action = 'edit'
          link.crud_type = :update
        elsif actions.include?(:show)
          link.action = 'show'
          link.crud_type = :read
        elsif actions.include?(:list)
          link.action = 'index'
          link.crud_type = :read
        end
        unless column_link_authorized?(link, link.column, record, associated)[0]
          link.action = nil
          if link.crud_type == :update && actions.include?(:show)
            link = configure_column_link(link, record, associated, [:show])
          end
        end
        link
      end
def configure_column_link ( link , record , associated , actions = nil ) actions ||= link . controller_actions || [ ] if column_empty? ( associated ) if actions . include? ( :new ) link . action = 'new' link . crud_type = :create link . label ||= :create_new end elsif actions . include? ( :edit ) link . action = 'edit' link . crud_type = :update elsif actions . include? ( :show ) link . action = 'show' link . crud_type = :read elsif actions . include? ( :list ) link . action = 'index' link . crud_type = :read end unless column_link_authorized? ( link , link . column , record , associated ) [ 0 ] link . action = nil if link . crud_type == :update && actions . include? ( :show ) link = configure_column_link ( link , record , associated , [ :show ] ) end end link end
params which mustn't be copying to nested links
params which mustn ' t be copying to nested links
# if association is empty, we only can link to create form # if action is edit and is not authorized, fallback to show if it's enabled
link
<not_specific>
record
<not_specific>
associated
<not_specific>
actions
<not_specific>