diff --git a/Gemfile b/Gemfile index bd1f43b..b64713e 100644 --- a/Gemfile +++ b/Gemfile @@ -64,6 +64,7 @@ gem 'contact_us', '>= 1.2.0' # COULD BE EASILY REPLACED WITH OUR OWN CODE gem 'recaptcha' gem 'dragonfly' # LOGO UPLOAD +gem 'formtastic' # ------------------------------------------------ # EXPORTING diff --git a/Gemfile.lock b/Gemfile.lock index ca4b10f..e9f1b96 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -132,6 +132,8 @@ loofah (~> 2.0) sax-machine (~> 1.0) flag_shih_tzu (0.3.15) + formtastic (3.1.4) + actionpack (>= 3.2.13) friendly_id (5.1.0) activerecord (>= 4.0.0) gettext_i18n_rails (1.8.0) @@ -352,6 +354,7 @@ dragonfly feedjira flag_shih_tzu + formtastic friendly_id gettext_i18n_rails (~> 1.8) htmltoword diff --git a/config/initializers/formtastic.rb b/config/initializers/formtastic.rb new file mode 100644 index 0000000..3cf1aef --- /dev/null +++ b/config/initializers/formtastic.rb @@ -0,0 +1,79 @@ +# encoding: utf-8 + +# Set the default text field size when input is a string. Default is nil. +# Formtastic::FormBuilder.default_text_field_size = 50 + +# Set the default text area height when input is a text. Default is 20. +# Formtastic::FormBuilder.default_text_area_height = 5 + +# Set the default text area width when input is a text. Default is nil. +# Formtastic::FormBuilder.default_text_area_width = 50 + +# Should all fields be considered "required" by default? +# Defaults to true. +# Formtastic::FormBuilder.all_fields_required_by_default = true + +# Should select fields have a blank option/prompt by default? +# Defaults to true. +# Formtastic::FormBuilder.include_blank_for_select_by_default = true + +# Set the string that will be appended to the labels/fieldsets which are required +# It accepts string or procs and the default is a localized version of +# '*'. In other words, if you configure formtastic.required +# in your locale, it will replace the abbr title properly. But if you don't want to use +# abbr tag, you can simply give a string as below +# Formtastic::FormBuilder.required_string = "(required)" + +# Set the string that will be appended to the labels/fieldsets which are optional +# Defaults to an empty string ("") and also accepts procs (see required_string above) +# Formtastic::FormBuilder.optional_string = "(optional)" + +# Set the way inline errors will be displayed. +# Defaults to :sentence, valid options are :sentence, :list, :first and :none +# Formtastic::FormBuilder.inline_errors = :sentence +# Formtastic uses the following classes as default for hints, inline_errors and error list + +# If you override the class here, please ensure to override it in your stylesheets as well +# Formtastic::FormBuilder.default_hint_class = "inline-hints" +# Formtastic::FormBuilder.default_inline_error_class = "inline-errors" +# Formtastic::FormBuilder.default_error_list_class = "errors" + +# Set the method to call on label text to transform or format it for human-friendly +# reading when formtastic is used without object. Defaults to :humanize. +# Formtastic::FormBuilder.label_str_method = :humanize + +# Set the array of methods to try calling on parent objects in :select and :radio inputs +# for the text inside each @