Sha256: b4e9ee6bca33d6df734fc226d371c2d80e2fec0d532014fd744c596239ab5340

Contents?: true

Size: 952 Bytes

Versions: 2

Compression:

Stored size: 952 Bytes

Contents

module ActiveScaffold::Config
  class Create < Form
    self.crud_type = :create
    def initialize(*args)
      super
      self.persistent = self.class.persistent
    end

    # global level configuration
    # --------------------------
    # the ActionLink for this action
    def self.link
      @@link
    end
    def self.link=(val)
      @@link = val
    end
    @@link = ActiveScaffold::DataStructures::ActionLink.new('new', :label => 'Create New', :type => :table, :security_method => :create_authorized?)

    # whether the form stays open after a create or not
    cattr_accessor :persistent
    @@persistent = false

    # instance-level configuration
    # ----------------------------
    # the label= method already exists in the Form base class
    def label
      @label ? as_(@label) : as_('Create %s', @core.label.singularize)
    end

    # whether the form stays open after a create or not
    attr_accessor :persistent
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
antfarm-0.3.0 rails/vendor/plugins/active_scaffold/lib/config/create.rb
antfarm-0.4.0 rails/vendor/plugins/active_scaffold/lib/config/create.rb