formulate 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -44,7 +44,7 @@ To customize the styles, you may set any of the variables used by the style
44
44
  sheet before importing it:
45
45
 
46
46
  ``` sass
47
- $input_focus_border_color: $blue
47
+ $input-focus-border-color: $blue
48
48
  $submit-button-color: $blue
49
49
 
50
50
  @import formulate
data/formulate.gemspec CHANGED
@@ -11,6 +11,7 @@ Gem::Specification.new do |gem|
11
11
 
12
12
  gem.add_dependency 'actionpack', '>= 3.0'
13
13
  gem.add_dependency 'activesupport', '>= 3.0'
14
+ gem.add_dependency 'carmen', '~> 0.2.0'
14
15
  gem.add_dependency 'haml', '>= 3.0'
15
16
  gem.add_dependency 'sass-rails', '>= 3.0'
16
17
 
@@ -1,3 +1,5 @@
1
+ require 'carmen'
2
+
1
3
  module Formulate
2
4
  class FormBuilder < ActionView::Helpers::FormBuilder
3
5
  def errors
@@ -72,6 +74,14 @@ module Formulate
72
74
  when :time_zone_select
73
75
  priority_zones = options.delete(:priority_zones)
74
76
  send(type, method, priority_zones, options)
77
+ when :state_select
78
+ country = options.delete(:country) || Carmen.default_country
79
+ html_options = options.delete(:html) || {}
80
+ send(type, method, country, options, html_options)
81
+ when :country_select
82
+ priority_countries = options.delete(:priority_countries)
83
+ html_options = options.delete(:html) || {}
84
+ send(type, method, priority_countries, options, html_options)
75
85
  else
76
86
  send(type, method, options)
77
87
  end
@@ -149,6 +159,14 @@ module Formulate
149
159
  input(method, options.merge(type: :datetime_select), &block)
150
160
  end
151
161
 
162
+ def state(method, options={}, &block)
163
+ input(method, options.merge(type: :state_select), &block)
164
+ end
165
+
166
+ def country(method, options={}, &block)
167
+ input(method, options.merge(type: :country_select), &block)
168
+ end
169
+
152
170
  def expiration(method, options={}, &block)
153
171
  options.reverse_merge!(add_month_numbers: true, discard_day: true, order: [:month, :year], start_year: Date.today.year, prompt: '')
154
172
  input(method, options.merge(type: :date_select), &block)
@@ -1,3 +1,3 @@
1
1
  module Formulate
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formulate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-28 00:00:00.000000000 Z
12
+ date: 2012-04-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -43,6 +43,22 @@ dependencies:
43
43
  - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
45
  version: '3.0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: carmen
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 0.2.0
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 0.2.0
46
62
  - !ruby/object:Gem::Dependency
47
63
  name: haml
48
64
  requirement: !ruby/object:Gem::Requirement