Class: Forma::Tab
Overview
This is a tab.
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
-
#icon ⇒ Object
readonly
Returns the value of attribute icon.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #action(url, h = {}) ⇒ Object
-
#add_field(f) ⇒ Object
Adding field to this tab.
-
#col1 {|@col1| ... } ⇒ Object
Returns the first column of this tab.
-
#col2 {|@col2| ... } ⇒ Object
Returns the second column of this tab.
-
#initialize(h = {}) ⇒ Tab
constructor
A new instance of Tab.
Methods included from FieldHelper
#array_field, #boolean_field, #combo_field, #complex_field, #date_field, #email_field, #file_field, #image_field, #map_field, #number_field, #password_field, #select_field, #subform, #table_field, #text_field
Constructor Details
#initialize(h = {}) ⇒ Tab
Returns a new instance of Tab.
213 214 215 216 217 218 219 220 |
# File 'lib/forma/form.rb', line 213 def initialize(h = {}) h = h.symbolize_keys @title = h[:title] @icon = h[:icon] @col1 = h[:col1] @col2 = h[:col2] @actions = h[:actions] || [] end |
Instance Attribute Details
#actions ⇒ Object (readonly)
Returns the value of attribute actions.
211 212 213 |
# File 'lib/forma/form.rb', line 211 def actions @actions end |
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
211 212 213 |
# File 'lib/forma/form.rb', line 211 def icon @icon end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
211 212 213 |
# File 'lib/forma/form.rb', line 211 def title @title end |
Instance Method Details
#action(url, h = {}) ⇒ Object
241 242 243 244 |
# File 'lib/forma/form.rb', line 241 def action(url, h={}) h[:url] = url @actions << Action.new(h) end |
#add_field(f) ⇒ Object
Adding field to this tab.
223 224 225 |
# File 'lib/forma/form.rb', line 223 def add_field(f) col1.add_field(f) end |