simple_form_bootstrap3 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/simple_form/action_view_extensions/bootstrap_form_helper.rb +39 -0
- data/lib/simple_form_bootstrap3/engine.rb +0 -6
- data/lib/simple_form_bootstrap3/version.rb +1 -1
- data/lib/simple_form_bootstrap3.rb +2 -0
- metadata +2 -2
- data/app/helpers/simple_form_bootstrap3/application_helper.rb +0 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a9696b44cc9a69cc3ffd208812aae7d77dfc743
|
4
|
+
data.tar.gz: e13ebafdc5aba29959628d407cc8c399b8f86bd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b00bf9a5e0b7ab3425e9932fae0934f23b4b7d58e093068df66d6a7cdca39a4c659fd5f763cfc26cc430db056a403ad4b7f6c98956e3bd34715a08f921340ad
|
7
|
+
data.tar.gz: 921b60c3a7ce280055894f1f27ea08f9f9a203c30ab09712f47fdd5e75652ec9d608f88b8893bf10a84969475b2f8202e1577352ca2172e19a080c7cd702997b
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module SimpleForm
|
2
|
+
module ActionViewExtensions
|
3
|
+
module BootstrapFormHelper
|
4
|
+
def horizontal_form_for(object, *args, &block)
|
5
|
+
options = args.extract_options!
|
6
|
+
options[:wrapper] ||= :horizontal
|
7
|
+
options[:builder] ||= SimpleForm::HorizontalFormBuilder
|
8
|
+
options[:html] ||= {}
|
9
|
+
options[:html][:role] = 'form'
|
10
|
+
options[:html][:class] = [ options[:html][:class], 'form-horizontal' ].compact.join(' ')
|
11
|
+
|
12
|
+
simple_form_for object, *(args << options), &block
|
13
|
+
end
|
14
|
+
|
15
|
+
def default_form_for(object, *args, &block)
|
16
|
+
options = args.extract_options!
|
17
|
+
options[:wrapper] ||= :default
|
18
|
+
options[:builder] ||= SimpleForm::DefaultFormBuilder
|
19
|
+
options[:html] ||= {}
|
20
|
+
options[:html][:role] = 'form'
|
21
|
+
|
22
|
+
simple_form_for object, *(args << options), &block
|
23
|
+
end
|
24
|
+
|
25
|
+
def inline_form_for(object, *args, &block)
|
26
|
+
options = args.extract_options!
|
27
|
+
options[:wrapper] ||= :inline
|
28
|
+
options[:builder] ||= SimpleForm::InlineFormBuilder
|
29
|
+
options[:html] ||= {}
|
30
|
+
options[:html][:role] = 'form'
|
31
|
+
options[:html][:class] = [ options[:html][:class], 'form-inline' ].compact.join(' ')
|
32
|
+
|
33
|
+
simple_form_for object, *(args << options), &block
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
ActionView::Base.send :include, SimpleForm::ActionViewExtensions::BootstrapFormHelper
|
@@ -1,11 +1,5 @@
|
|
1
1
|
module SimpleFormBootstrap3
|
2
2
|
class Engine < ::Rails::Engine
|
3
3
|
config.autoload_paths << File.expand_path("../../../lib", __FILE__)
|
4
|
-
|
5
|
-
initializer 'simple_form_bootstrap3.initialize' do
|
6
|
-
ActiveSupport.on_load :action_controller do
|
7
|
-
helper SimpleFormBootstrap3::ApplicationHelper
|
8
|
-
end
|
9
|
-
end
|
10
4
|
end
|
11
5
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_form_bootstrap3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuriy Kolodovskyy
|
@@ -45,11 +45,11 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
-
- app/helpers/simple_form_bootstrap3/application_helper.rb
|
49
48
|
- config/initializers/simple_form.rb
|
50
49
|
- config/initializers/simple_form_default.rb
|
51
50
|
- config/initializers/simple_form_horizontal.rb
|
52
51
|
- config/initializers/simple_form_inline.rb
|
52
|
+
- lib/simple_form/action_view_extensions/bootstrap_form_helper.rb
|
53
53
|
- lib/simple_form/default_form_builder.rb
|
54
54
|
- lib/simple_form/horizontal_form_builder.rb
|
55
55
|
- lib/simple_form/inline_form_builder.rb
|
@@ -1,35 +0,0 @@
|
|
1
|
-
module SimpleFormBootstrap3
|
2
|
-
module ApplicationHelper
|
3
|
-
def horizontal_form_for(object, *args, &block)
|
4
|
-
options = args.extract_options!
|
5
|
-
options[:wrapper] ||= :horizontal
|
6
|
-
options[:builder] ||= SimpleForm::HorizontalFormBuilder
|
7
|
-
options[:html] ||= {}
|
8
|
-
options[:html][:role] = 'form'
|
9
|
-
options[:html][:class] = [ options[:html][:class], 'form-horizontal' ].compact.join(' ')
|
10
|
-
|
11
|
-
simple_form_for object, *(args << options), &block
|
12
|
-
end
|
13
|
-
|
14
|
-
def default_form_for(object, *args, &block)
|
15
|
-
options = args.extract_options!
|
16
|
-
options[:wrapper] ||= :default
|
17
|
-
options[:builder] ||= SimpleForm::DefaultFormBuilder
|
18
|
-
options[:html] ||= {}
|
19
|
-
options[:html][:role] = 'form'
|
20
|
-
|
21
|
-
simple_form_for object, *(args << options), &block
|
22
|
-
end
|
23
|
-
|
24
|
-
def inline_form_for(object, *args, &block)
|
25
|
-
options = args.extract_options!
|
26
|
-
options[:wrapper] ||= :inline
|
27
|
-
options[:builder] ||= SimpleForm::InlineFormBuilder
|
28
|
-
options[:html] ||= {}
|
29
|
-
options[:html][:role] = 'form'
|
30
|
-
options[:html][:class] = [ options[:html][:class], 'form-inline' ].compact.join(' ')
|
31
|
-
|
32
|
-
simple_form_for object, *(args << options), &block
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|