diff --git a/Gemfile b/Gemfile index 7009a518..c7f6a766 100644 --- a/Gemfile +++ b/Gemfile @@ -52,7 +52,7 @@ gem 'uglifier', '>= 1.3.0' gem 'bootstrap-sass', '~> 3.3.4.1' gem 'autoprefixer-rails' gem 'formtastic-bootstrap' -gem 'formtastic', '~> 2.3.0.rc3' +gem 'formtastic', '~> 3.1.1' gem 'cocoon' # frontend javascripts diff --git a/Gemfile.lock b/Gemfile.lock index 5dd6fdd0..8fe4b905 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -164,10 +164,10 @@ GEM font-awesome-rails (4.1.0.0) railties (>= 3.2, < 5.0) formatador (0.2.4) - formtastic (2.3.0.rc3) - actionpack (>= 3.0) - formtastic-bootstrap (3.0.0) - formtastic (>= 2.2) + formtastic (3.1.3) + actionpack (>= 3.2.13) + formtastic-bootstrap (3.1.1) + formtastic (>= 3.0) geocoder (1.2.2) globalid (0.3.6) activesupport (>= 4.1.0) @@ -501,7 +501,7 @@ DEPENDENCIES devise_ichain_authenticatable factory_girl_rails font-awesome-rails - formtastic (~> 2.3.0.rc3) + formtastic (~> 3.1.1) formtastic-bootstrap gravtastic guard-rspec (~> 4.2.8) diff --git a/config/application.rb b/config/application.rb index 91ac6591..6f863991 100644 --- a/config/application.rb +++ b/config/application.rb @@ -60,5 +60,9 @@ module Osem # Version of your assets, change this if you want to expire all your assets config.assets.version = '1.0' + + # Errors raised within `after_rollback`/`after_commit` propagate normally + # like in other Active Record callbacks. + config.active_record.raise_in_transactional_callbacks = true end end diff --git a/config/environments/production.rb b/config/environments/production.rb index 69c7f9de..97bb10d6 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -15,7 +15,7 @@ Osem::Application.configure do config.eager_load = true # Disable Rails's static asset server (Apache or nginx will already do this) - config.serve_static_assets = false + config.serve_static_files = false # Compress JavaScripts and CSS config.assets.compress = true diff --git a/config/environments/test.rb b/config/environments/test.rb index d33fbc31..42d753ee 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -8,7 +8,7 @@ Osem::Application.configure do config.cache_classes = true # Configure static asset server for tests with Cache-Control for performance - config.serve_static_assets = true + config.serve_static_files = true config.static_cache_control = 'public, max-age=3600' # Do not eager load code on boot. diff --git a/config/initializers/formtastic.rb b/config/initializers/formtastic.rb index 4374676b..f21da2e7 100644 --- a/config/initializers/formtastic.rb +++ b/config/initializers/formtastic.rb @@ -66,14 +66,48 @@ Formtastic::FormBuilder.required_string = proc { Formtastic::Util.html_safe(%{&n # specifying that class here. Defaults to Formtastic::FormBuilder. # Formtastic::Helpers::FormHelper.builder = MyCustomBuilder +# All formtastic forms have a class that indicates that they are just that. You +# can change it to any class you want. +# Formtastic::Helpers::FormHelper.default_form_class = 'formtastic' + +# Formtastic will infer a class name from the model, array, string ot symbol you pass to the +# form builder. You can customize the way that class is presented by overriding +# this proc. +# Formtastic::Helpers::FormHelper.default_form_model_class_proc = proc { |model_class_name| model_class_name } + +# Allows to set a custom field_error_proc wrapper. By default this wrapper +# is disabled since `formtastic` already adds an error class to the LI tag +# containing the input. +# Formtastic::Helpers::FormHelper.formtastic_field_error_proc = proc { |html_tag, instance_tag| html_tag } + # You can opt-in to Formtastic's use of the HTML5 `required` attribute on ``, `