bootstrap_forms 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +8 -0
- data/bootstrap_forms.gemspec +1 -1
- data/lib/bootstrap_forms/form_builder.rb +5 -0
- data/lib/bootstrap_forms/initializer.rb +0 -5
- metadata +2 -2
data/README.markdown
CHANGED
@@ -4,6 +4,14 @@ Bootstrap Forms is a nice Rails generator that makes working with [Bootstrap (by
|
|
4
4
|
|
5
5
|
Forms with Bootstrap are crowded with additional layout markup. While it's necessary, you shouldn't have to type it every time you create a form! That's why I created Bootstrap Forms.
|
6
6
|
|
7
|
+
Note/Caution/Warning
|
8
|
+
--------------------
|
9
|
+
There were **major** changes in the release of version `0.1.0`:
|
10
|
+
|
11
|
+
1. The gem name has officially changed from `bootstrap-forms` to `bootstrap_forms` to match gem naming conventions. The old gem still exists on rubygems for legacy applications, however, you should update to the new gem as quickly as possible. It's faster and more stable. The old gem is no longer maintained.
|
12
|
+
2. `form_for` is no longer overridden by default. There were multiple users who were concerned that this behavior was ill advised. Instead, a new form helper, `bootstrap_form_for` has been created. This is in line with other form building libraries.
|
13
|
+
3. The gem is now a Rails 3 Engine. As such, **Bootstrap Forms will not work in < Rails 3.0**. The engine is automatically mounted when including the gem in your `Gemfile`.
|
14
|
+
|
7
15
|
Installation
|
8
16
|
------------
|
9
17
|
Add it to your `Gemfile`:
|
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 = "0.1.
|
6
|
+
s.version = "0.1.1"
|
7
7
|
s.author = "Seth Vargo"
|
8
8
|
s.email = "sethvargo@gmail.com"
|
9
9
|
s.homepage = "https://github.com/sethvargo/bootstrap_forms"
|
@@ -17,6 +17,11 @@ module BootstrapForms
|
|
17
17
|
'' # return empty string
|
18
18
|
end
|
19
19
|
end
|
20
|
+
|
21
|
+
def bootstrap_fields_for(record_name, record_object = nil, options = {}, &block)
|
22
|
+
options[:builder] = BootstrapForms::FormBuilder
|
23
|
+
fields_for(record_name, record_object, options, &block)
|
24
|
+
end
|
20
25
|
|
21
26
|
%w(collection_select select check_box 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|
|
22
27
|
define_method(method_name) do |name, *args|
|
@@ -9,11 +9,6 @@ module ActionView
|
|
9
9
|
f.error_messages.html_safe + capture(f, &block).html_safe
|
10
10
|
end
|
11
11
|
end
|
12
|
-
|
13
|
-
def bootstrap_fields_for(record_name, record_object = nil, options = {}, &block)
|
14
|
-
options[:builder] = BootstrapForms::FormBuilder
|
15
|
-
fields_for(record_name, record_object, options, &block)
|
16
|
-
end
|
17
12
|
end
|
18
13
|
end
|
19
14
|
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: 0.1.
|
4
|
+
version: 0.1.1
|
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-01-
|
12
|
+
date: 2012-01-21 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.
|