effective_qb_sync 1.0.0
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.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +94 -0
- data/Rakefile +21 -0
- data/app/controllers/admin/qb_syncs_controller.rb +60 -0
- data/app/controllers/effective/qb_sync_controller.rb +40 -0
- data/app/models/effective/access_denied.rb +17 -0
- data/app/models/effective/datatables/qb_syncs.rb +30 -0
- data/app/models/effective/qb_log.rb +13 -0
- data/app/models/effective/qb_machine.rb +281 -0
- data/app/models/effective/qb_order_item.rb +13 -0
- data/app/models/effective/qb_order_items_form.rb +55 -0
- data/app/models/effective/qb_request.rb +262 -0
- data/app/models/effective/qb_ticket.rb +55 -0
- data/app/models/effective/qbwc_supervisor.rb +89 -0
- data/app/views/admin/qb_syncs/_actions.html.haml +2 -0
- data/app/views/admin/qb_syncs/_qb_item_names.html.haml +9 -0
- data/app/views/admin/qb_syncs/index.html.haml +24 -0
- data/app/views/admin/qb_syncs/instructions.html.haml +136 -0
- data/app/views/admin/qb_syncs/show.html.haml +52 -0
- data/app/views/effective/orders_mailer/qb_sync_error.html.haml +56 -0
- data/app/views/effective/qb_sync/authenticate.erb +12 -0
- data/app/views/effective/qb_sync/clientVersion.erb +8 -0
- data/app/views/effective/qb_sync/closeConnection.erb +8 -0
- data/app/views/effective/qb_sync/connectionError.erb +9 -0
- data/app/views/effective/qb_sync/getLastError.erb +9 -0
- data/app/views/effective/qb_sync/receiveResponseXML.erb +8 -0
- data/app/views/effective/qb_sync/sendRequestXML.erb +8 -0
- data/app/views/effective/qb_sync/serverVersion.erb +8 -0
- data/app/views/effective/qb_web_connector/quickbooks.qwc.erb +12 -0
- data/config/routes.rb +16 -0
- data/db/migrate/01_create_effective_qb_sync.rb.erb +68 -0
- data/lib/effective_qb_sync/engine.rb +42 -0
- data/lib/effective_qb_sync/version.rb +3 -0
- data/lib/effective_qb_sync.rb +42 -0
- data/lib/generators/effective_qb_sync/install_generator.rb +42 -0
- data/lib/generators/templates/effective_qb_sync.rb +61 -0
- data/lib/generators/templates/effective_qb_sync_mailer_preview.rb +39 -0
- data/spec/dummy/README.rdoc +8 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/product.rb +14 -0
- data/spec/dummy/app/models/product_with_float_price.rb +13 -0
- data/spec/dummy/app/models/user.rb +14 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config/application.rb +32 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +80 -0
- data/spec/dummy/config/environments/test.rb +36 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/devise.rb +254 -0
- data/spec/dummy/config/initializers/effective_addresses.rb +15 -0
- data/spec/dummy/config/initializers/effective_orders.rb +154 -0
- data/spec/dummy/config/initializers/effective_qb_sync.rb +41 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/simple_form.rb +189 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/schema.rb +208 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +90 -0
- data/spec/dummy/log/test.log +1 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/fixtures/qbxml_response_error.xml +6 -0
- data/spec/fixtures/qbxml_response_success.xml +621 -0
- data/spec/models/acts_as_purchasable_spec.rb +131 -0
- data/spec/models/factories_spec.rb +32 -0
- data/spec/models/qb_machine_spec.rb +554 -0
- data/spec/models/qb_request_spec.rb +327 -0
- data/spec/models/qb_ticket_spec.rb +62 -0
- data/spec/spec_helper.rb +45 -0
- data/spec/support/factories.rb +97 -0
- metadata +397 -0
|
@@ -0,0 +1,154 @@
|
|
|
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
|
+
# Register Effective::Order with ActiveAdmin if ActiveAdmin is present
|
|
35
|
+
config.use_active_admin = true
|
|
36
|
+
|
|
37
|
+
# Use effective_obfuscation gem to change order.id into a seemingly random 10-digit number
|
|
38
|
+
config.obfuscate_order_ids = false
|
|
39
|
+
|
|
40
|
+
# Silence the price deprecation warnings
|
|
41
|
+
config.silence_deprecation_warnings = true
|
|
42
|
+
|
|
43
|
+
# Require these addresses when creating a new Order. Works with effective_addresses gem
|
|
44
|
+
config.require_billing_address = true
|
|
45
|
+
config.require_shipping_address = true
|
|
46
|
+
|
|
47
|
+
# Use billing/shipping address full name in checkout process. Address full name will be validated.
|
|
48
|
+
# Works with effective_addresses gem
|
|
49
|
+
config.use_address_full_name = true
|
|
50
|
+
|
|
51
|
+
# If set, the orders#new screen will render effective/orders/user_fields partial and capture this User Info
|
|
52
|
+
# The partial can be overridden to customize the form, but the following fields are also fed into strong_paramters
|
|
53
|
+
config.collect_user_fields = [:first_name, :last_name]
|
|
54
|
+
#config.collect_user_fields = [:salutation, :first_name, :last_name] # Must be valid fields on the User object
|
|
55
|
+
|
|
56
|
+
# Don't validate_associated :user when saving an Order
|
|
57
|
+
config.skip_user_validation = false
|
|
58
|
+
|
|
59
|
+
config.collect_note = true
|
|
60
|
+
config.collect_note_message = 'please enter a note'
|
|
61
|
+
|
|
62
|
+
# Minimum Charge
|
|
63
|
+
# Prevent orders less than this value from being purchased
|
|
64
|
+
# Stripe doesn't allow orders less than $0.50
|
|
65
|
+
# Set to nil for no minimum charge
|
|
66
|
+
# Default value is 50 cents, or $0.50
|
|
67
|
+
config.minimum_charge = 50
|
|
68
|
+
|
|
69
|
+
# Free Orders
|
|
70
|
+
# Allow orders with a total of 0.00 to be purchased (regardless of the minimum charge setting)
|
|
71
|
+
# When enabled, the checkout process will skip the paypal/stripe/purchasing step
|
|
72
|
+
# and just display the 'Thank You' after checkout is clicked
|
|
73
|
+
config.allow_free_orders = true
|
|
74
|
+
|
|
75
|
+
# Allow Pretend Purchase in Production
|
|
76
|
+
# WARNING: Setting this option to true will allow users to purchase! an Order without entering a credit card
|
|
77
|
+
# WARNING: When true, users can purchase! anything without paying money
|
|
78
|
+
#
|
|
79
|
+
# This should basically always be false, but sometimes you want to make a Beta/Demo site
|
|
80
|
+
# where users may test the purchase workflow without actually paying money
|
|
81
|
+
#
|
|
82
|
+
# When true, there will be a 'Process Order' button on the Checkout screen.
|
|
83
|
+
# Clicking this button will mark an Order purchased and redirect the user to the
|
|
84
|
+
# Thank You page just as if they had successfully Checked Out through a payment processor
|
|
85
|
+
config.allow_pretend_purchase_in_production = false
|
|
86
|
+
config.allow_pretend_purchase_in_production_message = '* payment information is not required to process this order at this time.'
|
|
87
|
+
|
|
88
|
+
# Pay by Cheque
|
|
89
|
+
# Allow user to create pending orders in order to pay for it by cheque offline. Pending orders are not
|
|
90
|
+
# considered purchased and have 'pending' purchase state
|
|
91
|
+
#
|
|
92
|
+
# When true, there will be a 'Pay by Cheque' button on the Checkout screen.
|
|
93
|
+
# Clicking this button will mark an Order pending and redirect the user to the
|
|
94
|
+
# pending order page.
|
|
95
|
+
config.cheque_enabled = true
|
|
96
|
+
|
|
97
|
+
# Show/hide the 'Order History' button on the 'Cart Page'
|
|
98
|
+
config.show_order_history_button = true
|
|
99
|
+
|
|
100
|
+
# Layout Settings
|
|
101
|
+
# Configure the Layout per controller, or all at once
|
|
102
|
+
|
|
103
|
+
config.layout = 'application' # All EffectiveOrders controllers will use this layout
|
|
104
|
+
|
|
105
|
+
# SimpleForm Options
|
|
106
|
+
# This Hash of options will be passed into any simple_form_for() calls
|
|
107
|
+
config.simple_form_options = {}
|
|
108
|
+
|
|
109
|
+
# config.simple_form_options = {
|
|
110
|
+
# html: {class: 'form-horizontal'},
|
|
111
|
+
# wrapper: :horizontal_form,
|
|
112
|
+
# wrapper_mappings: {
|
|
113
|
+
# boolean: :horizontal_boolean,
|
|
114
|
+
# check_boxes: :horizontal_radio_and_checkboxes,
|
|
115
|
+
# radio_buttons: :horizontal_radio_and_checkboxes
|
|
116
|
+
# }
|
|
117
|
+
# }
|
|
118
|
+
|
|
119
|
+
# Mailer Settings
|
|
120
|
+
# effective_orders will send out receipts to the buyer, seller and admins.
|
|
121
|
+
# For all the emails, the same :subject_prefix will be prefixed. Leave as nil / empty string if you don't want any prefix
|
|
122
|
+
#
|
|
123
|
+
# The subject_for_admin_receipt, subject_for_buyer_receipt, subject_for_payment_request and
|
|
124
|
+
# subject_for_seller_receipt can be one of:
|
|
125
|
+
# - nil / empty string to use the built in defaults
|
|
126
|
+
# - A string with the full subject line for this email
|
|
127
|
+
# - A Proc to create the subject line based on the email
|
|
128
|
+
# In all three of these cases, the subject_prefix will still be used.
|
|
129
|
+
|
|
130
|
+
# The Procs are the same for admin & buyer receipt, the seller Proc is different
|
|
131
|
+
# subject_for_admin_receipt: Proc.new { |order| "Order #{order.to_param} has been purchased"}
|
|
132
|
+
# subject_for_buyer_receipt: Proc.new { |order| "Order #{order.to_param} has been purchased"}
|
|
133
|
+
# subject_for_payment_request: Proc.new { |order| "Pending Order #{order.to_param}"}
|
|
134
|
+
# subject_for_seller_receipt: Proc.new { |order, order_items, seller| "Order #{order.to_param} has been purchased"}
|
|
135
|
+
|
|
136
|
+
config.mailer = {
|
|
137
|
+
send_order_receipt_to_admin: true,
|
|
138
|
+
send_order_receipt_to_buyer: true,
|
|
139
|
+
send_payment_request_to_buyer: true,
|
|
140
|
+
send_order_receipts_when_marked_paid_by_admin: false,
|
|
141
|
+
send_order_receipt_to_seller: true, # Only applies to StripeConnect
|
|
142
|
+
layout: 'effective_orders_mailer_layout',
|
|
143
|
+
admin_email: 'admin@example.com',
|
|
144
|
+
default_from: 'info@example.com',
|
|
145
|
+
subject_prefix: '[example]',
|
|
146
|
+
subject_for_admin_receipt: '',
|
|
147
|
+
subject_for_buyer_receipt: '',
|
|
148
|
+
subject_for_payment_request: '',
|
|
149
|
+
subject_for_seller_receipt: '',
|
|
150
|
+
deliver_method: nil,
|
|
151
|
+
delayed_job_deliver: false
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# EffectiveQbSync Rails Engine
|
|
2
|
+
|
|
3
|
+
EffectiveQbSync.setup do |config|
|
|
4
|
+
# Configure Database Tables
|
|
5
|
+
config.qb_requests_table_name = :qb_requests
|
|
6
|
+
config.qb_tickets_table_name = :qb_tickets
|
|
7
|
+
config.qb_logs_table_name = :qb_logs
|
|
8
|
+
config.qb_order_items_table_name = :qb_order_items
|
|
9
|
+
|
|
10
|
+
# Authorization Method
|
|
11
|
+
#
|
|
12
|
+
# This method is called by all controller actions with the appropriate action and resource
|
|
13
|
+
# If the method returns false, an Effective::AccessDenied Error will be raised (see README.md for complete info)
|
|
14
|
+
#
|
|
15
|
+
# Use via Proc (and with CanCan):
|
|
16
|
+
# config.authorization_method = Proc.new { |controller, action, resource| authorize!(action, resource) }
|
|
17
|
+
#
|
|
18
|
+
# Use via custom method:
|
|
19
|
+
# config.authorization_method = :my_authorization_method
|
|
20
|
+
#
|
|
21
|
+
# And then in your application_controller.rb:
|
|
22
|
+
#
|
|
23
|
+
# def my_authorization_method(action, resource)
|
|
24
|
+
# current_user.is?(:admin)
|
|
25
|
+
# end
|
|
26
|
+
#
|
|
27
|
+
# Or disable the check completely:
|
|
28
|
+
# config.authorization_method = false
|
|
29
|
+
config.authorization_method = Proc.new { |controller, action, resource| true }
|
|
30
|
+
|
|
31
|
+
# Quickbooks Company File Settings
|
|
32
|
+
|
|
33
|
+
# The username / password of the Quickbooks user that should be allowed to synchronize.
|
|
34
|
+
# This must match the user configured in the Quickbooks .qwc file
|
|
35
|
+
config.quickbooks_username = 'username'
|
|
36
|
+
config.quickbooks_password = 'password'
|
|
37
|
+
|
|
38
|
+
# The Item Name/Number used for tax. Must match the configured Quickbooks .qwc file
|
|
39
|
+
config.quickbooks_tax_name = 'GST Collected'
|
|
40
|
+
|
|
41
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
|
@@ -0,0 +1,189 @@
|
|
|
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
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
|
2
|
+
|
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
|
4
|
+
# is enabled by default.
|
|
5
|
+
|
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
|
7
|
+
ActiveSupport.on_load(:action_controller) do
|
|
8
|
+
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# To enable root element in JSON for ActiveRecord objects.
|
|
12
|
+
# ActiveSupport.on_load(:active_record) do
|
|
13
|
+
# self.include_root_in_json = true
|
|
14
|
+
# end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Files in the config/locales directory are used for internationalization
|
|
2
|
+
# and are automatically loaded by Rails. If you want to use locales other
|
|
3
|
+
# than English, add the necessary files in this directory.
|
|
4
|
+
#
|
|
5
|
+
# To use the locales, use `I18n.t`:
|
|
6
|
+
#
|
|
7
|
+
# I18n.t 'hello'
|
|
8
|
+
#
|
|
9
|
+
# In views, this is aliased to just `t`:
|
|
10
|
+
#
|
|
11
|
+
# <%= t('hello') %>
|
|
12
|
+
#
|
|
13
|
+
# To use a different locale, set it with `I18n.locale`:
|
|
14
|
+
#
|
|
15
|
+
# I18n.locale = :es
|
|
16
|
+
#
|
|
17
|
+
# This would use the information in config/locales/es.yml.
|
|
18
|
+
#
|
|
19
|
+
# To learn more, please read the Rails Internationalization guide
|
|
20
|
+
# available at http://guides.rubyonrails.org/i18n.html.
|
|
21
|
+
|
|
22
|
+
en:
|
|
23
|
+
hello: "Hello world"
|