bootstrap_forms 1.0.4 → 1.0.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.
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "bootstrap_forms"
6
- s.version = "1.0.4"
6
+ s.version = "1.0.5"
7
7
  s.author = "Seth Vargo"
8
8
  s.email = "sethvargo@gmail.com"
9
9
  s.homepage = "https://github.com/sethvargo/bootstrap_forms"
@@ -17,7 +17,7 @@ module BootstrapForms
17
17
  end
18
18
  end
19
19
 
20
- %w(collection_select select email_field file_field number_field password_field phone_field radio_button range_field search_field telephone_field text_area text_field url_field).each do |method_name|
20
+ %w(collection_select select email_field file_field number_field password_field phone_field range_field search_field telephone_field text_area text_field url_field).each do |method_name|
21
21
  define_method(method_name) do |name, *args|
22
22
  @name = name
23
23
  @field_options = args.extract_options!
@@ -118,18 +118,20 @@ module BootstrapForms
118
118
  end
119
119
  end
120
120
 
121
- def submit(name = nil, *args)
122
- @name = name
123
- @field_options = args.extract_options!
124
- @args = args
121
+ %w(submit button).each do |method_name|
122
+ define_method(method_name) do |name=nil, *args|
123
+ @name = name
124
+ @field_options = args.extract_options!
125
+ @args = args
125
126
 
126
- @field_options[:class] = 'btn btn-primary'
127
+ @field_options[:class] = 'btn btn-primary'
127
128
 
128
- content_tag(:div, :class => 'form-actions') do
129
- if @field_options[:include_cancel] == false
130
- super(name, *(args << @field_options))
131
- else
132
- super(name, *(args << @field_options)) + ' ' + link_to(I18n.t('bootstrap_forms.buttons.cancel'), (@field_options[:back] || :back), :class => 'btn cancel')
129
+ content_tag(:div, :class => 'form-actions') do
130
+ if @field_options[:include_cancel] == false
131
+ super(name, *(args << @field_options))
132
+ else
133
+ super(name, *(args << @field_options)) + ' ' + link_to(I18n.t('bootstrap_forms.buttons.cancel'), (@field_options[:back] || :back), :class => 'btn cancel')
134
+ end
133
135
  end
134
136
  end
135
137
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap_forms
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
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-02-08 00:00:00.000000000 Z
12
+ date: 2012-02-20 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Bootstrap Forms makes Twitter's Bootstrap on Rails easy to use by creating
15
15
  helpful form builders that minimize markup in your views.