Class: ActiveScaffold::Config::Form

Inherits:
Base show all
Defined in:
lib/active_scaffold/config/form.rb

Direct Known Subclasses

Create, Update

Constant Summary collapse

@@persistent =
false
@@refresh_list =
false
false

Constants inherited from Base

Base::NO_FORMATS

Instance Attribute Summary collapse

Attributes inherited from Base

#action_group, #core, #formats, #user_settings_key

Instance Method Summary collapse

Methods inherited from Base

#crud_type, inherited, #label, #model_id, #new_user_settings, #setup_user_setting_key, #user

Methods included from ActiveScaffold::Configurable

#configure, #method_missing, #respond_to_missing?

Constructor Details

#initialize(core_config) ⇒ Form

Returns a new instance of Form.



3
4
5
6
7
8
9
10
11
12
# File 'lib/active_scaffold/config/form.rb', line 3

def initialize(core_config)
  super
  @show_unauthorized_columns = self.class.show_unauthorized_columns
  @refresh_list = self.class.refresh_list
  @persistent = self.class.persistent
  @floating_footer = self.class.floating_footer

  # no global setting here because multipart should only be set for specific forms
  @multipart = false
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ActiveScaffold::Configurable

Instance Attribute Details

whether footer should float when form is too long to fit in the screen, so footer is always available while scrolling



50
51
52
# File 'lib/active_scaffold/config/form.rb', line 50

def floating_footer
  @floating_footer
end

#label=(value) ⇒ Object (writeonly)

the label for this Form action. used for the header.



41
42
43
# File 'lib/active_scaffold/config/form.rb', line 41

def label=(value)
  @label = value
end

the ActionLink for this action



38
39
40
# File 'lib/active_scaffold/config/form.rb', line 38

def link
  @link
end

#multipart=(value) ⇒ Object (writeonly)

whether the form should be multipart



58
59
60
# File 'lib/active_scaffold/config/form.rb', line 58

def multipart=(value)
  @multipart = value
end

#persistentObject

whether the form stays open after a create or not



44
45
46
# File 'lib/active_scaffold/config/form.rb', line 44

def persistent
  @persistent
end

#refresh_listObject

whether we should refresh list after create or not



47
48
49
# File 'lib/active_scaffold/config/form.rb', line 47

def refresh_list
  @refresh_list
end

#show_unauthorized_columnsObject

show value of unauthorized columns instead of skip them



35
36
37
# File 'lib/active_scaffold/config/form.rb', line 35

def show_unauthorized_columns
  @show_unauthorized_columns
end

Instance Method Details

#multipart?Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/active_scaffold/config/form.rb', line 59

def multipart?
  @multipart ? true : false
end