Class: AdminAssistant::FormSettings

Inherits:
AbstractSettings show all
Defined in:
lib/admin_assistant/builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractSettings

#[], #columns

Constructor Details

#initialize(admin_assistant) ⇒ FormSettings

Returns a new instance of FormSettings.



159
160
161
162
163
# File 'lib/admin_assistant/builder.rb', line 159

def initialize(admin_assistant)
  super
  @submit_buttons = []
  @multi = false
end

Instance Attribute Details

#multi=(value) ⇒ Object (writeonly)

Sets the attribute multi

Parameters:

  • value

    the value to set the attribute multi to.



156
157
158
# File 'lib/admin_assistant/builder.rb', line 156

def multi=(value)
  @multi = value
end

#submit_buttonsObject (readonly)

Returns the value of attribute submit_buttons.



157
158
159
# File 'lib/admin_assistant/builder.rb', line 157

def submit_buttons
  @submit_buttons
end

Instance Method Details

#column_config_fieldsObject



165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/admin_assistant/builder.rb', line 165

def column_config_fields
  {:clear_link => :accessor,
   :datetime_select_options => [:accessor, {}],
   :date_select_options => [:accessor, {}], :default => :block,
   :description => :accessor, :exclude_blank => :boolean,
   :image_size => :accessor, :input => :accessor,
   :read_only => :boolean, :select_choices => :accessor,
   :select_options => [
    :accessor,
    Proc.new { |v|
      v ||= {}
      unless v.has_key?(:include_blank)
        v[:include_blank] = true
      end
      v
    }
   ],
   :text_area_options => [:accessor, {}], :write_once => :boolean
  }
end

#column_namesObject



202
203
204
# File 'lib/admin_assistant/builder.rb', line 202

def column_names
  @column_names || @admin_assistant.default_column_names
end

#columns_for_edit(*args) ⇒ Object



186
187
188
189
190
191
192
# File 'lib/admin_assistant/builder.rb', line 186

def columns_for_edit(*args)
  if args.empty?
    @columns_for_edit || column_names
  else
    @columns_for_edit = args
  end
end

#columns_for_new(*args) ⇒ Object



194
195
196
197
198
199
200
# File 'lib/admin_assistant/builder.rb', line 194

def columns_for_new(*args)
  if args.empty?
    @columns_for_new || column_names
  else
    @columns_for_new = args
  end
end

#multi?Boolean

Returns:

  • (Boolean)


206
207
208
# File 'lib/admin_assistant/builder.rb', line 206

def multi?
  @multi
end