formic 0.2.1 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.5
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{formic}
8
- s.version = "0.2.1"
8
+ s.version = "0.2.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Vinh Tran"]
@@ -20,6 +20,7 @@ module Formic
20
20
  :checkbox,
21
21
  :list,
22
22
  :list_item,
23
+ :list_items,
23
24
  :tab,
24
25
  :form,
25
26
  :tab_panel,
@@ -16,7 +16,7 @@ module Formic
16
16
  end
17
17
 
18
18
  super options, &block
19
- @field = name
19
+ @field = name || options[:name]
20
20
 
21
21
  if !options[:name]
22
22
  if @field && self.form && self.form.model
@@ -9,4 +9,4 @@
9
9
  %input{:type => "hidden", :name => "_method", :value => _method}
10
10
 
11
11
  .title= title
12
- =capture &content unless content.nil?
12
+ =capture_haml &content unless content.nil?
@@ -1,3 +1,3 @@
1
1
  - content = element.content
2
2
  %ul{element.options}
3
- =capture &content unless content.nil?
3
+ =capture_haml &content unless content.nil?
@@ -1,5 +1,5 @@
1
- - selection_options = options.delete(:options)
2
- - value = options.delete(:value) || ''
1
+ - selection_options = element.options.delete(:options)
2
+ - value = element.options.delete(:value) || ''
3
3
  - content = element.content
4
4
 
5
5
  %label= element.label
@@ -7,7 +7,15 @@
7
7
  %span.required *
8
8
 
9
9
  %select{element.options}
10
- - selection_options.each_pair do |option_name, option_value|
11
- - selected = value && option_value == value
12
- %option{:value => option_value, :selected => selected}= option_name
13
- =capture &content if content.nil?
10
+ - if selection_options.instance_of Hash
11
+ - selection_options.each_pair do |option_name, option_value|
12
+ - selected = value && option_value == value
13
+ %option{:value => option_value, :selected => selected}= option_name
14
+
15
+ - elsif selection_options.instance_of Array
16
+ - selection_options.each do | option_name |
17
+ - selected = value && option_value == value
18
+ %option{:value => option_value, :selected => selected}= option_value
19
+
20
+ =capture_haml &content if !content.nil?
21
+
@@ -1,3 +1,3 @@
1
1
  - content = element.content
2
2
  %div{element.options}
3
- =capture &content unless content.nil?
3
+ =capture_haml &content unless content.nil?
@@ -1,5 +1,5 @@
1
1
  - content = element.content
2
- - content_string = content.nil? ? '' : capture(&content)
2
+ - content_string = content.nil? ? '' : capture_haml(&content)
3
3
  %div{element.options}
4
4
  %ul.panel_headers
5
5
  - element.tabs.each do |tab|
@@ -1,4 +1,4 @@
1
- %label= label
1
+ %label= element.label
2
2
  - if element.has_class? 'required'
3
3
  %span.required *
4
- %textarea{options}= value
4
+ %textarea{element.options}= element.options[:value]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: formic
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.1
5
+ version: 0.2.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - Vinh Tran
@@ -183,7 +183,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
183
183
  requirements:
184
184
  - - ">="
185
185
  - !ruby/object:Gem::Version
186
- hash: -1315801625866261702
186
+ hash: -3780060715784344000
187
187
  segments:
188
188
  - 0
189
189
  version: "0"