effective_orders 3.0.0 → 3.0.1

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.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/effective_orders/version.rb +1 -1
  4. metadata +10 -258
  5. data/spec/controllers/admin/orders_controller_spec.rb +0 -243
  6. data/spec/controllers/carts_controller_spec.rb +0 -143
  7. data/spec/controllers/ccbill_orders_controller_spec.rb +0 -103
  8. data/spec/controllers/moneris_orders_controller_spec.rb +0 -133
  9. data/spec/controllers/orders_controller_spec.rb +0 -500
  10. data/spec/controllers/stripe_orders_controller_spec.rb +0 -128
  11. data/spec/controllers/webhooks_controller_spec.rb +0 -170
  12. data/spec/dummy/README.rdoc +0 -8
  13. data/spec/dummy/Rakefile +0 -6
  14. data/spec/dummy/app/assets/javascripts/application.js +0 -13
  15. data/spec/dummy/app/assets/stylesheets/application.css +0 -15
  16. data/spec/dummy/app/controllers/application_controller.rb +0 -5
  17. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  18. data/spec/dummy/app/models/product.rb +0 -9
  19. data/spec/dummy/app/models/product_with_float_price.rb +0 -9
  20. data/spec/dummy/app/models/user.rb +0 -11
  21. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  22. data/spec/dummy/bin/bundle +0 -3
  23. data/spec/dummy/bin/rails +0 -4
  24. data/spec/dummy/bin/rake +0 -4
  25. data/spec/dummy/config.ru +0 -4
  26. data/spec/dummy/config/application.rb +0 -32
  27. data/spec/dummy/config/boot.rb +0 -5
  28. data/spec/dummy/config/database.yml +0 -25
  29. data/spec/dummy/config/environment.rb +0 -5
  30. data/spec/dummy/config/environments/development.rb +0 -37
  31. data/spec/dummy/config/environments/production.rb +0 -80
  32. data/spec/dummy/config/environments/test.rb +0 -36
  33. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  34. data/spec/dummy/config/initializers/cookies_serializer.rb +0 -3
  35. data/spec/dummy/config/initializers/devise.rb +0 -254
  36. data/spec/dummy/config/initializers/effective_addresses.rb +0 -15
  37. data/spec/dummy/config/initializers/effective_orders.rb +0 -269
  38. data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  39. data/spec/dummy/config/initializers/inflections.rb +0 -16
  40. data/spec/dummy/config/initializers/mime_types.rb +0 -4
  41. data/spec/dummy/config/initializers/session_store.rb +0 -3
  42. data/spec/dummy/config/initializers/simple_form.rb +0 -189
  43. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  44. data/spec/dummy/config/locales/en.yml +0 -23
  45. data/spec/dummy/config/routes.rb +0 -3
  46. data/spec/dummy/config/secrets.yml +0 -22
  47. data/spec/dummy/db/schema.rb +0 -158
  48. data/spec/dummy/db/test.sqlite3 +0 -0
  49. data/spec/dummy/log/development.log +0 -164
  50. data/spec/dummy/log/test.log +0 -60
  51. data/spec/dummy/public/404.html +0 -67
  52. data/spec/dummy/public/422.html +0 -67
  53. data/spec/dummy/public/500.html +0 -66
  54. data/spec/dummy/public/favicon.ico +0 -0
  55. data/spec/fixtures/stripe_webhooks/invoice.payment_succeeded.without_renewals.json +0 -76
  56. data/spec/helpers/effective_orders_helper_spec.rb +0 -21
  57. data/spec/models/acts_as_purchasable_spec.rb +0 -75
  58. data/spec/models/customer_spec.rb +0 -72
  59. data/spec/models/factories_spec.rb +0 -35
  60. data/spec/models/order_item_spec.rb +0 -35
  61. data/spec/models/order_spec.rb +0 -445
  62. data/spec/models/stripe_charge_spec.rb +0 -39
  63. data/spec/models/subscription_spec.rb +0 -103
  64. data/spec/spec_helper.rb +0 -46
  65. data/spec/support/factories.rb +0 -139
@@ -1,15 +0,0 @@
1
- EffectiveAddresses.setup do |config|
2
- # Database table name to store addresses in. Default is :addresses
3
- config.addresses_table_name = :addresses
4
-
5
- # Display Full Name on Address forms, and validate presence by default
6
- # (can be overridden on a per address basis)
7
- config.use_full_name = true
8
-
9
- # Country codes to display in country_select dropdowns.
10
- config.country_codes = :all #
11
- config.country_codes_priority = ['US', 'CA'] # Leave empty array for no priority countries
12
-
13
- # Or you can be more selective...
14
- #config.country_codes = ['US', 'CA']
15
- end
@@ -1,269 +0,0 @@
1
- # EffectiveOrders Rails Engine
2
-
3
- EffectiveOrders.setup do |config|
4
- # Configure Database Tables
5
- config.orders_table_name = :orders
6
- config.order_items_table_name = :order_items
7
- config.carts_table_name = :carts
8
- config.cart_items_table_name = :cart_items
9
- config.customers_table_name = :customers
10
- config.subscriptions_table_name = :subscriptions
11
- config.products_table_name = :custom_products
12
-
13
- # Authorization Method
14
- #
15
- # This method is called by all controller actions with the appropriate action and resource
16
- # If the method returns false, an Effective::AccessDenied Error will be raised (see README.md for complete info)
17
- #
18
- # Use via Proc (and with CanCan):
19
- # config.authorization_method = Proc.new { |controller, action, resource| can?(action, resource) }
20
- #
21
- # Use via custom method:
22
- # config.authorization_method = :my_authorization_method
23
- #
24
- # And then in your application_controller.rb:
25
- #
26
- # def my_authorization_method(action, resource)
27
- # current_user.is?(:admin)
28
- # end
29
- #
30
- # Or disable the check completely:
31
- # config.authorization_method = false
32
- config.authorization_method = Proc.new { |controller, action, resource| true }
33
-
34
- # Use effective_obfuscation gem to change order.id into a seemingly random 10-digit number
35
- config.obfuscate_order_ids = true
36
-
37
- # Require these addresses when creating a new Order. Works with effective_addresses gem
38
- config.require_billing_address = true
39
- config.require_shipping_address = true
40
-
41
- # Use billing/shipping address full name in checkout process. Address full name will be validated.
42
- # Works with effective_addresses gem
43
- config.use_address_full_name = true
44
-
45
- # If set, the orders#new screen will render effective/orders/user_fields partial and capture this User Info
46
- # The partial can be overridden to customize the form, but the following fields are also fed into strong_paramters
47
- config.collect_user_fields = [:first_name, :last_name]
48
- #config.collect_user_fields = [:salutation, :first_name, :last_name] # Must be valid fields on the User object
49
-
50
- # Don't validate_associated :user when saving an Order
51
- config.skip_user_validation = false
52
-
53
- config.collect_note = true
54
- config.collect_note_message = 'please enter a note'
55
-
56
- # Minimum Charge
57
- # Prevent orders less than this value from being purchased
58
- # Stripe doesn't allow orders less than $0.50
59
- # Set to nil for no minimum charge
60
- # Default value is 50 cents, or $0.50
61
- config.minimum_charge = 50
62
-
63
- # Free Orders
64
- # Allow orders with a total of 0.00 to be purchased (regardless of the minimum charge setting)
65
- # When enabled, the checkout process will skip the paypal/stripe/purchasing step
66
- # and just display the 'Thank You' after checkout is clicked
67
- config.allow_free_orders = true
68
-
69
- # Allow Pretend Purchase in Production
70
- # WARNING: Setting this option to true will allow users to purchase! an Order without entering a credit card
71
- # WARNING: When true, users can purchase! anything without paying money
72
- #
73
- # This should basically always be false, but sometimes you want to make a Beta/Demo site
74
- # where users may test the purchase workflow without actually paying money
75
- #
76
- # When true, there will be a 'Process Order' button on the Checkout screen.
77
- # Clicking this button will mark an Order purchased and redirect the user to the
78
- # Thank You page just as if they had successfully Checked Out through a payment processor
79
- config.allow_pretend_purchase_in_production = false
80
- config.allow_pretend_purchase_in_production_message = '* payment information is not required to process this order at this time.'
81
-
82
- # Pay by Cheque
83
- # Allow user to create pending orders in order to pay for it by cheque offline. Pending orders are not
84
- # considered purchased and have 'pending' purchase state
85
- #
86
- # When true, there will be a 'Pay by Cheque' button on the Checkout screen.
87
- # Clicking this button will mark an Order pending and redirect the user to the
88
- # pending order page.
89
- config.cheque_enabled = true
90
-
91
- config.cheque = {
92
- confirm: 'Your order will not be considered purchased until we receive your cheque. Proceed with pay by cheque?',
93
- success_message: 'Thank you! You have indicated that this order will be purchased by cheque. Please send us a cheque and a copy of this invoice at your earliest convenience. We will mark this order purchased upon receiving payment.'
94
- }
95
-
96
- # Show/hide the 'Order History' button on the 'Cart Page'
97
- config.show_order_history_button = true
98
-
99
- # Layout Settings
100
- # Configure the Layout per controller, or all at once
101
-
102
- # config.layout = 'application' # All EffectiveOrders controllers will use this layout
103
- config.layout = {
104
- carts: 'application',
105
- orders: 'application',
106
- subscriptions: 'application',
107
- admin_customers: 'application',
108
- admin_orders: 'application'
109
- }
110
-
111
- # SimpleForm Options
112
- # This Hash of options will be passed into any simple_form_for() calls
113
- config.simple_form_options = {}
114
-
115
- # config.simple_form_options = {
116
- # html: {class: 'form-horizontal'},
117
- # wrapper: :horizontal_form,
118
- # wrapper_mappings: {
119
- # boolean: :horizontal_boolean,
120
- # check_boxes: :horizontal_radio_and_checkboxes,
121
- # radio_buttons: :horizontal_radio_and_checkboxes
122
- # }
123
- # }
124
-
125
- # Mailer Settings
126
- # effective_orders will send out receipts to the buyer, seller and admins.
127
- # For all the emails, the same :subject_prefix will be prefixed. Leave as nil / empty string if you don't want any prefix
128
- #
129
- # The subject_for_admin_receipt, subject_for_buyer_receipt, subject_for_payment_request and
130
- # subject_for_seller_receipt can be one of:
131
- # - nil / empty string to use the built in defaults
132
- # - A string with the full subject line for this email
133
- # - A Proc to create the subject line based on the email
134
- # In all three of these cases, the subject_prefix will still be used.
135
-
136
- # The Procs are the same for admin & buyer receipt, the seller Proc is different
137
- # subject_for_admin_receipt: Proc.new { |order| "Order #{order.to_param} has been purchased"}
138
- # subject_for_buyer_receipt: Proc.new { |order| "Order #{order.to_param} has been purchased"}
139
- # subject_for_payment_request: Proc.new { |order| "Pending Order #{order.to_param}"}
140
- # subject_for_seller_receipt: Proc.new { |order, order_items, seller| "Order #{order.to_param} has been purchased"}
141
-
142
- config.mailer = {
143
- send_order_receipt_to_admin: true,
144
- send_order_receipt_to_buyer: true,
145
- send_payment_request_to_buyer: true,
146
- send_order_receipts_when_marked_paid_by_admin: false,
147
- send_order_receipt_to_seller: true, # Only applies to StripeConnect
148
- layout: 'effective_orders_mailer_layout',
149
- admin_email: 'admin@example.com',
150
- default_from: 'info@example.com',
151
- subject_prefix: '[example]',
152
- subject_for_admin_receipt: '',
153
- subject_for_buyer_receipt: '',
154
- subject_for_payment_request: '',
155
- subject_for_seller_receipt: '',
156
- deliver_method: nil,
157
- delayed_job_deliver: false
158
- }
159
-
160
- # Moneris configuration
161
- config.moneris_enabled = true
162
-
163
- if Rails.env.production?
164
- config.moneris = {
165
- ps_store_id: '',
166
- hpp_key: '',
167
- hpp_url: 'https://www3.moneris.com/HPPDP/index.php',
168
- verify_url: 'https://www3.moneris.com/HPPDP/verifyTxn.php'
169
- }
170
- else
171
- config.moneris = {
172
- ps_store_id: 'foo',
173
- hpp_key: 'bar',
174
- hpp_url: 'https://esqa.moneris.com/HPPDP/index.php',
175
- verify_url: 'https://esqa.moneris.com/HPPDP/verifyTxn.php'
176
- }
177
- end
178
-
179
- # Paypal configuration
180
- config.paypal_enabled = true
181
-
182
- if Rails.env.production?
183
- config.paypal = {
184
- seller_email: '',
185
- secret: '',
186
- cert_id: '',
187
- paypal_url: 'https://www.paypal.com/cgi-bin/webscr',
188
- currency: 'CAD',
189
- paypal_cert: "#{Rails.root}/config/paypalcerts/production/paypal_cert.pem",
190
- app_cert: "#{Rails.root}/config/paypalcerts/production/app_cert.pem",
191
- app_key: "#{Rails.root}/config/paypalcerts/production/app_key.pem"
192
- }
193
- else
194
- config.paypal = {
195
- seller_email: 'seller@mail.com',
196
- secret: 'foo',
197
- cert_id: 'bar',
198
- paypal_url: 'https://www.sandbox.paypal.com/cgi-bin/webscr',
199
- currency: 'CAD',
200
- paypal_cert: "#{Rails.root}/config/paypalcerts/#{Rails.env}/paypal_cert.pem",
201
- app_cert: "#{Rails.root}/config/paypalcerts/#{Rails.env}/app_cert.pem",
202
- app_key: "#{Rails.root}/config/paypalcerts/#{Rails.env}/app_key.pem"
203
- }
204
- end
205
-
206
- # Stripe configuration
207
- config.stripe_enabled = true
208
- config.subscriptions_enabled = true # https://stripe.com/docs/subscriptions
209
- config.stripe_connect_enabled = false # https://stripe.com/docs/connect
210
- config.stripe_connect_application_fee_method = Proc.new { |order_item| order_item.total * 0.10 } # 10 percent
211
-
212
- if Rails.env.production?
213
- config.stripe = {
214
- secret_key: '',
215
- publishable_key: '',
216
- currency: 'usd',
217
- site_title: 'My Site',
218
- site_image: '', # A relative URL pointing to a square image of your brand or product. The recommended minimum size is 128x128px.
219
- connect_client_id: ''
220
- }
221
- else
222
- config.stripe = {
223
- secret_key: 'foo',
224
- publishable_key: 'bar',
225
- currency: 'usd',
226
- site_title: 'My Development Site', # Displayed on the Embedded Stripe Form
227
- site_image: 'foo', # A relative URL pointing to a square image of your brand or product. The recommended minimum size is 128x128px.
228
- connect_client_id: 'bar'
229
- }
230
- end
231
-
232
- # CCBill configuration
233
- config.ccbill_enabled = true
234
-
235
- # CCBill Dynamic Pricing documentation describes these variables:
236
- # https://www.ccbill.com/cs/wiki/tiki-index.php?page=Dynamic+Pricing+User+Guide
237
- if Rails.env.production?
238
- config.ccbill = {
239
- client_accnum: '',
240
- client_subacc: '',
241
- # Get this from CCBill Admin dashboard after setting up a form
242
- form_name: '',
243
- form_period: '',
244
- # https://www.ccbill.com/cs/wiki/tiki-index.php?page=Webhooks+User+Guide#Appendix_A:_Currency_Codes
245
- currency_code: '',
246
- # You'll get this salt value from CCBill tech support
247
- # https://www.ccbill.com/cs/wiki/tiki-index.php?page=Dynamic+Pricing+User+Guide#Generating_the_MD5_Hash
248
- dynamic_pricing_salt: ''
249
- }
250
- else
251
- config.ccbill = {
252
- client_accnum: 'foo',
253
- client_subacc: 'bar',
254
- form_name: 'foo',
255
- form_period: 'bar',
256
- currency_code: 'foo',
257
- dynamic_pricing_salt: 'bar'
258
- }
259
- end
260
-
261
- # App checkout configuration
262
- config.app_checkout_enabled = false
263
-
264
- config.app_checkout = {
265
- checkout_label: '', # Checkout button to finalize the order
266
- service: nil, # an EffectiveOrders::AppCheckout type object
267
- declined_flash: "Payment was unsuccessful. Please try again."
268
- }
269
- end
@@ -1,4 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Configure sensitive parameters which will be filtered from the log file.
4
- Rails.application.config.filter_parameters += [:password]
@@ -1,16 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new inflection rules using the following format. Inflections
4
- # are locale specific, and you may define rules for as many different
5
- # locales as you wish. All of these examples are active by default:
6
- # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
- # inflect.plural /^(ox)$/i, '\1en'
8
- # inflect.singular /^(ox)en/i, '\1'
9
- # inflect.irregular 'person', 'people'
10
- # inflect.uncountable %w( fish sheep )
11
- # end
12
-
13
- # These inflection rules are supported but not enabled by default:
14
- # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
- # inflect.acronym 'RESTful'
16
- # end
@@ -1,4 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new mime types for use in respond_to blocks:
4
- # Mime::Type.register "text/richtext", :rtf
@@ -1,3 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- Rails.application.config.session_store :cookie_store, key: '_dummy_session'
@@ -1,189 +0,0 @@
1
- # Use this setup block to configure all options available in SimpleForm.
2
- SimpleForm.setup do |config|
3
- config.error_notification_class = 'alert alert-danger'
4
- config.button_class = 'btn btn-primary'
5
- config.boolean_label_class = nil
6
-
7
- config.boolean_style = :nested
8
- config.browser_validations = true
9
-
10
- config.default_form_class = ''
11
- config.default_wrapper = :vertical_form
12
-
13
- config.wrapper_mappings = {
14
- :boolean => :vertical_boolean,
15
- :check_boxes => :vertical_radio_and_checkboxes,
16
- :radio_buttons => :vertical_radio_and_checkboxes,
17
-
18
- :horizontal_form => {
19
- :boolean => :horizontal_boolean,
20
- :check_boxes => :horizontal_radio_and_checkboxes,
21
- :radio_buttons => :horizontal_radio_and_checkboxes
22
- }
23
- }
24
-
25
-
26
- config.wrappers :vertical_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
27
- b.use :html5
28
- b.use :placeholder
29
- b.optional :maxlength
30
- b.optional :pattern
31
- b.optional :min_max
32
- b.optional :readonly
33
- b.use :label, class: 'control-label'
34
-
35
- b.use :input, class: 'form-control'
36
- b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
37
- b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
38
- end
39
-
40
- config.wrappers :vertical_file_input, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
41
- b.use :html5
42
- b.use :placeholder
43
- b.optional :maxlength
44
- b.optional :readonly
45
- b.use :label, class: 'control-label'
46
-
47
- b.use :input
48
- b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
49
- b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
50
- end
51
-
52
- config.wrappers :vertical_boolean, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
53
- b.use :html5
54
- b.optional :readonly
55
-
56
- b.wrapper tag: 'div', class: 'checkbox' do |ba|
57
- ba.use :label_input
58
- end
59
-
60
- b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
61
- b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
62
- end
63
-
64
- config.wrappers :vertical_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
65
- b.use :html5
66
- b.optional :readonly
67
- b.use :label_input, :class => 'control-label'
68
- b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
69
- b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
70
- end
71
-
72
- config.wrappers :vertical_inline_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
73
- b.use :html5
74
- b.optional :readonly
75
-
76
- b.use :label, class: 'control-label'
77
-
78
- b.wrapper tag: 'div', class: 'inline-radio-or-checkboxes' do |ba|
79
- ba.use :input
80
- end
81
-
82
- b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
83
- b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
84
- end
85
-
86
- config.wrappers :horizontal_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
87
- b.use :html5
88
- b.use :placeholder
89
- b.optional :maxlength
90
- b.optional :pattern
91
- b.optional :min_max
92
- b.optional :readonly
93
- b.use :label, class: 'col-sm-3 control-label'
94
-
95
- b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
96
- ba.use :input, class: 'form-control'
97
- ba.use :error, wrap_with: { tag: 'span', class: 'help-block' }
98
- ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
99
- end
100
- end
101
-
102
- config.wrappers :form_3columns, tag: 'div', class: 'col-sm-4' do |b|
103
- b.use :html5
104
- b.use :placeholder
105
- b.optional :maxlength
106
- b.optional :pattern
107
- b.optional :min_max
108
- b.optional :readonly
109
-
110
- b.wrapper tag: 'div', class: 'form-group', error_class: 'has-error' do |ba|
111
- ba.use :label
112
- ba.use :input, class: 'form-control'
113
- ba.use :error, wrap_with: { tag: 'span', class: 'help-block' }
114
- ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
115
- end
116
- end
117
-
118
- config.wrappers :horizontal_file_input, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
119
- b.use :html5
120
- b.use :placeholder
121
- b.optional :maxlength
122
- b.optional :readonly
123
- b.use :label, class: 'col-sm-3 control-label'
124
-
125
- b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
126
- ba.use :input
127
- ba.use :error, wrap_with: { tag: 'span', class: 'help-block' }
128
- ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
129
- end
130
- end
131
-
132
- config.wrappers :horizontal_boolean, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
133
- b.use :html5
134
- b.optional :readonly
135
-
136
- b.wrapper tag: 'div', class: 'col-sm-offset-3 col-sm-9' do |wr|
137
- wr.wrapper tag: 'div', class: 'checkbox' do |ba|
138
- ba.use :label_input, class: 'col-sm-9'
139
- end
140
-
141
- wr.use :error, wrap_with: { tag: 'span', class: 'help-block' }
142
- wr.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
143
- end
144
- end
145
-
146
- config.wrappers :horizontal_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
147
- b.use :html5
148
- b.optional :readonly
149
-
150
- b.use :label, class: 'col-sm-3 control-label'
151
-
152
- b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
153
- ba.use :input
154
- ba.use :error, wrap_with: { tag: 'span', class: 'help-block' }
155
- ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
156
- end
157
- end
158
-
159
- config.wrappers :horizontal_inline_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
160
- b.use :html5
161
- b.optional :readonly
162
-
163
- b.use :label, class: 'col-sm-3 control-label'
164
-
165
- b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
166
- ba.wrapper tag: 'div', :class => 'inline-radio-or-checkboxes' do |bb|
167
- bb.use :input
168
- end
169
-
170
- ba.use :error, wrap_with: { tag: 'span', class: 'help-block' }
171
- ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
172
- end
173
- end
174
-
175
- config.wrappers :inline_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
176
- b.use :html5
177
- b.use :placeholder
178
- b.optional :maxlength
179
- b.optional :pattern
180
- b.optional :min_max
181
- b.optional :readonly
182
- b.use :label, class: 'sr-only'
183
-
184
- b.use :input, class: 'form-control'
185
- b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
186
- b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
187
- end
188
-
189
- end