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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 87a485a19bd40dfd50f3b21c4fc02866e4bba818
4
- data.tar.gz: a70184407bd36859c59a092b391b1600c210b8bf
3
+ metadata.gz: 7a9696b44cc9a69cc3ffd208812aae7d77dfc743
4
+ data.tar.gz: e13ebafdc5aba29959628d407cc8c399b8f86bd0
5
5
  SHA512:
6
- metadata.gz: f0919ea2d0817941e65a4f4fef448c88f881532b3cf591c21f597e417d7ce6b2f266bfcec156da5640b708874d9ca4e0bf7b6cd3e54c56596ed84f6ffac275fe
7
- data.tar.gz: 110f711fc3b1c9cbd6df502baa5df98ec54819e9e3e555679df8074ea01c8ad26d99bf691ac2fcc43a69a643031f59882a67b8457e637d3ccd5f5e5f1dfbf0fd
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
@@ -1,3 +1,3 @@
1
1
  module SimpleFormBootstrap3
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -1,7 +1,9 @@
1
1
  require 'bootstrap-sass'
2
2
  require 'simple_form'
3
+ require 'simple_form/action_view_extensions/bootstrap_form_helper'
3
4
 
4
5
  require 'simple_form_bootstrap3/engine'
5
6
 
6
7
  module SimpleFormBootstrap3
8
+
7
9
  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.0
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