bootstrap_forms 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/bootstrap_forms.gemspec +1 -1
- data/lib/bootstrap_forms/form_builder.rb +13 -11
- metadata +2 -2
data/bootstrap_forms.gemspec
CHANGED
@@ -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.
|
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
|
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
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
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
|
-
|
127
|
+
@field_options[:class] = 'btn btn-primary'
|
127
128
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
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
|
+
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-
|
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.
|