rails_apps_composer: generators
This commit is contained in:
parent
321db01949
commit
519879b551
46
Gemfile
46
Gemfile
|
@ -46,3 +46,49 @@ group :development do
|
|||
gem 'spring'
|
||||
end
|
||||
|
||||
|
||||
gem 'administrate'
|
||||
gem 'bootstrap-sass'
|
||||
gem 'devise'
|
||||
gem 'devise_invitable'
|
||||
gem 'haml-rails'
|
||||
gem 'high_voltage'
|
||||
gem 'pundit'
|
||||
gem 'simple_form'
|
||||
|
||||
group :development do
|
||||
gem 'better_errors'
|
||||
gem 'capistrano', '~> 3.0.1'
|
||||
gem 'capistrano-bundler'
|
||||
gem 'capistrano-rails', '~> 1.1.0'
|
||||
gem 'capistrano-rails-console'
|
||||
gem 'capistrano-rvm', '~> 0.1.1'
|
||||
gem 'guard-bundler'
|
||||
gem 'guard-rails'
|
||||
gem 'guard-rspec'
|
||||
gem 'html2haml'
|
||||
gem 'hub', :require=>nil
|
||||
gem 'quiet_assets'
|
||||
gem 'rails_apps_pages'
|
||||
gem 'rails_apps_testing'
|
||||
gem 'rails_layout'
|
||||
gem 'rb-fchange', :require=>false
|
||||
gem 'rb-fsevent', :require=>false
|
||||
gem 'rb-inotify', :require=>false
|
||||
gem 'spring-commands-rspec'
|
||||
end
|
||||
|
||||
group :development, :test do
|
||||
gem 'factory_girl_rails'
|
||||
gem 'faker'
|
||||
gem 'puma'
|
||||
gem 'rspec-rails'
|
||||
end
|
||||
|
||||
group :test do
|
||||
gem 'capybara'
|
||||
gem 'database_cleaner'
|
||||
gem 'launchy'
|
||||
gem 'selenium-webdriver'
|
||||
end
|
||||
|
||||
|
|
|
@ -0,0 +1,385 @@
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
actionmailer (4.2.6)
|
||||
actionpack (= 4.2.6)
|
||||
actionview (= 4.2.6)
|
||||
activejob (= 4.2.6)
|
||||
mail (~> 2.5, >= 2.5.4)
|
||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||
actionpack (4.2.6)
|
||||
actionview (= 4.2.6)
|
||||
activesupport (= 4.2.6)
|
||||
rack (~> 1.6)
|
||||
rack-test (~> 0.6.2)
|
||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||
actionview (4.2.6)
|
||||
activesupport (= 4.2.6)
|
||||
builder (~> 3.1)
|
||||
erubis (~> 2.7.0)
|
||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||
activejob (4.2.6)
|
||||
activesupport (= 4.2.6)
|
||||
globalid (>= 0.3.0)
|
||||
activemodel (4.2.6)
|
||||
activesupport (= 4.2.6)
|
||||
builder (~> 3.1)
|
||||
activerecord (4.2.6)
|
||||
activemodel (= 4.2.6)
|
||||
activesupport (= 4.2.6)
|
||||
arel (~> 6.0)
|
||||
activesupport (4.2.6)
|
||||
i18n (~> 0.7)
|
||||
json (~> 1.7, >= 1.7.7)
|
||||
minitest (~> 5.1)
|
||||
thread_safe (~> 0.3, >= 0.3.4)
|
||||
tzinfo (~> 1.1)
|
||||
addressable (2.4.0)
|
||||
administrate (0.1.4)
|
||||
autoprefixer-rails (~> 6.0)
|
||||
datetime_picker_rails (~> 0.0.7)
|
||||
jquery-rails (~> 4.0)
|
||||
kaminari (~> 0.16)
|
||||
momentjs-rails (~> 2.8)
|
||||
neat (~> 1.1)
|
||||
normalize-rails (~> 3.0)
|
||||
rails (~> 4.2)
|
||||
sass-rails (~> 5.0)
|
||||
selectize-rails (~> 0.6)
|
||||
arel (6.0.3)
|
||||
autoprefixer-rails (6.3.4)
|
||||
execjs
|
||||
bcrypt (3.1.11)
|
||||
better_errors (2.1.1)
|
||||
coderay (>= 1.0.0)
|
||||
erubis (>= 2.6.6)
|
||||
rack (>= 0.9.0)
|
||||
binding_of_caller (0.7.2)
|
||||
debug_inspector (>= 0.0.1)
|
||||
bootstrap-sass (3.3.6)
|
||||
autoprefixer-rails (>= 5.2.1)
|
||||
sass (>= 3.3.4)
|
||||
bourbon (4.2.6)
|
||||
sass (~> 3.4)
|
||||
thor (~> 0.19)
|
||||
builder (3.2.2)
|
||||
byebug (8.2.2)
|
||||
capistrano (3.0.1)
|
||||
i18n
|
||||
rake (>= 10.0.0)
|
||||
sshkit (>= 0.0.23)
|
||||
capistrano-bundler (1.1.2)
|
||||
capistrano (~> 3.0)
|
||||
sshkit (~> 1.2)
|
||||
capistrano-rails (1.1.0)
|
||||
capistrano (>= 3.0.0)
|
||||
capistrano-bundler (>= 1.0.0)
|
||||
capistrano-rails-console (0.5.2)
|
||||
capistrano (>= 3.0.0, < 4.0.0)
|
||||
capistrano-rvm (0.1.2)
|
||||
capistrano (~> 3.0)
|
||||
sshkit (~> 1.2)
|
||||
capybara (2.6.2)
|
||||
addressable
|
||||
mime-types (>= 1.16)
|
||||
nokogiri (>= 1.3.3)
|
||||
rack (>= 1.0.0)
|
||||
rack-test (>= 0.5.4)
|
||||
xpath (~> 2.0)
|
||||
childprocess (0.5.9)
|
||||
ffi (~> 1.0, >= 1.0.11)
|
||||
coderay (1.1.1)
|
||||
coffee-rails (4.1.1)
|
||||
coffee-script (>= 2.2.0)
|
||||
railties (>= 4.0.0, < 5.1.x)
|
||||
coffee-script (2.4.1)
|
||||
coffee-script-source
|
||||
execjs
|
||||
coffee-script-source (1.10.0)
|
||||
concurrent-ruby (1.0.1)
|
||||
database_cleaner (1.5.1)
|
||||
datetime_picker_rails (0.0.7)
|
||||
momentjs-rails (>= 2.8.1)
|
||||
debug_inspector (0.0.2)
|
||||
devise (3.5.6)
|
||||
bcrypt (~> 3.0)
|
||||
orm_adapter (~> 0.1)
|
||||
railties (>= 3.2.6, < 5)
|
||||
responders
|
||||
thread_safe (~> 0.1)
|
||||
warden (~> 1.2.3)
|
||||
devise_invitable (1.5.5)
|
||||
actionmailer (>= 3.2.6, < 5)
|
||||
devise (>= 3.2.0)
|
||||
diff-lcs (1.2.5)
|
||||
erubis (2.7.0)
|
||||
execjs (2.6.0)
|
||||
factory_girl (4.5.0)
|
||||
activesupport (>= 3.0.0)
|
||||
factory_girl_rails (4.6.0)
|
||||
factory_girl (~> 4.5.0)
|
||||
railties (>= 3.0.0)
|
||||
faker (1.6.3)
|
||||
i18n (~> 0.5)
|
||||
ffi (1.9.10)
|
||||
formatador (0.2.5)
|
||||
globalid (0.3.6)
|
||||
activesupport (>= 4.1.0)
|
||||
guard (2.13.0)
|
||||
formatador (>= 0.2.4)
|
||||
listen (>= 2.7, <= 4.0)
|
||||
lumberjack (~> 1.0)
|
||||
nenv (~> 0.1)
|
||||
notiffany (~> 0.0)
|
||||
pry (>= 0.9.12)
|
||||
shellany (~> 0.0)
|
||||
thor (>= 0.18.1)
|
||||
guard-bundler (2.1.0)
|
||||
bundler (~> 1.0)
|
||||
guard (~> 2.2)
|
||||
guard-compat (~> 1.1)
|
||||
guard-compat (1.2.1)
|
||||
guard-rails (0.7.2)
|
||||
guard (~> 2.11)
|
||||
guard-compat (~> 1.0)
|
||||
guard-rspec (4.6.4)
|
||||
guard (~> 2.1)
|
||||
guard-compat (~> 1.1)
|
||||
rspec (>= 2.99.0, < 4.0)
|
||||
haml (4.0.7)
|
||||
tilt
|
||||
haml-rails (0.9.0)
|
||||
actionpack (>= 4.0.1)
|
||||
activesupport (>= 4.0.1)
|
||||
haml (>= 4.0.6, < 5.0)
|
||||
html2haml (>= 1.0.1)
|
||||
railties (>= 4.0.1)
|
||||
high_voltage (2.4.0)
|
||||
html2haml (2.0.0)
|
||||
erubis (~> 2.7.0)
|
||||
haml (~> 4.0.0)
|
||||
nokogiri (~> 1.6.0)
|
||||
ruby_parser (~> 3.5)
|
||||
hub (1.12.4)
|
||||
i18n (0.7.0)
|
||||
jbuilder (2.4.1)
|
||||
activesupport (>= 3.0.0, < 5.1)
|
||||
multi_json (~> 1.2)
|
||||
jquery-rails (4.1.1)
|
||||
rails-dom-testing (>= 1, < 3)
|
||||
railties (>= 4.2.0)
|
||||
thor (>= 0.14, < 2.0)
|
||||
json (1.8.3)
|
||||
kaminari (0.16.3)
|
||||
actionpack (>= 3.0.0)
|
||||
activesupport (>= 3.0.0)
|
||||
launchy (2.4.3)
|
||||
addressable (~> 2.3)
|
||||
listen (3.0.6)
|
||||
rb-fsevent (>= 0.9.3)
|
||||
rb-inotify (>= 0.9.7)
|
||||
loofah (2.0.3)
|
||||
nokogiri (>= 1.5.9)
|
||||
lumberjack (1.0.10)
|
||||
mail (2.6.3)
|
||||
mime-types (>= 1.16, < 3)
|
||||
method_source (0.8.2)
|
||||
mime-types (2.99.1)
|
||||
mini_portile2 (2.0.0)
|
||||
minitest (5.8.4)
|
||||
momentjs-rails (2.11.0)
|
||||
railties (>= 3.1)
|
||||
multi_json (1.11.2)
|
||||
neat (1.7.4)
|
||||
bourbon (>= 4.0)
|
||||
sass (>= 3.3)
|
||||
nenv (0.3.0)
|
||||
net-scp (1.2.1)
|
||||
net-ssh (>= 2.6.5)
|
||||
net-ssh (3.1.0)
|
||||
nokogiri (1.6.7.2)
|
||||
mini_portile2 (~> 2.0.0.rc2)
|
||||
normalize-rails (3.0.3)
|
||||
notiffany (0.0.8)
|
||||
nenv (~> 0.1)
|
||||
shellany (~> 0.0)
|
||||
orm_adapter (0.5.0)
|
||||
pry (0.10.3)
|
||||
coderay (~> 1.1.0)
|
||||
method_source (~> 0.8.1)
|
||||
slop (~> 3.4)
|
||||
puma (3.2.0)
|
||||
pundit (1.1.0)
|
||||
activesupport (>= 3.0.0)
|
||||
quiet_assets (1.1.0)
|
||||
railties (>= 3.1, < 5.0)
|
||||
rack (1.6.4)
|
||||
rack-test (0.6.3)
|
||||
rack (>= 1.0)
|
||||
rails (4.2.6)
|
||||
actionmailer (= 4.2.6)
|
||||
actionpack (= 4.2.6)
|
||||
actionview (= 4.2.6)
|
||||
activejob (= 4.2.6)
|
||||
activemodel (= 4.2.6)
|
||||
activerecord (= 4.2.6)
|
||||
activesupport (= 4.2.6)
|
||||
bundler (>= 1.3.0, < 2.0)
|
||||
railties (= 4.2.6)
|
||||
sprockets-rails
|
||||
rails-deprecated_sanitizer (1.0.3)
|
||||
activesupport (>= 4.2.0.alpha)
|
||||
rails-dom-testing (1.0.7)
|
||||
activesupport (>= 4.2.0.beta, < 5.0)
|
||||
nokogiri (~> 1.6.0)
|
||||
rails-deprecated_sanitizer (>= 1.0.1)
|
||||
rails-html-sanitizer (1.0.3)
|
||||
loofah (~> 2.0)
|
||||
rails_apps_pages (0.6.4)
|
||||
rails_apps_testing (0.3.12)
|
||||
rails_layout (1.0.29)
|
||||
railties (4.2.6)
|
||||
actionpack (= 4.2.6)
|
||||
activesupport (= 4.2.6)
|
||||
rake (>= 0.8.7)
|
||||
thor (>= 0.18.1, < 2.0)
|
||||
rake (11.1.1)
|
||||
rb-fchange (0.0.6)
|
||||
ffi
|
||||
rb-fsevent (0.9.7)
|
||||
rb-inotify (0.9.7)
|
||||
ffi (>= 0.5.0)
|
||||
responders (2.1.2)
|
||||
railties (>= 4.2.0, < 5.1)
|
||||
rspec (3.4.0)
|
||||
rspec-core (~> 3.4.0)
|
||||
rspec-expectations (~> 3.4.0)
|
||||
rspec-mocks (~> 3.4.0)
|
||||
rspec-core (3.4.4)
|
||||
rspec-support (~> 3.4.0)
|
||||
rspec-expectations (3.4.0)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.4.0)
|
||||
rspec-mocks (3.4.1)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.4.0)
|
||||
rspec-rails (3.4.2)
|
||||
actionpack (>= 3.0, < 4.3)
|
||||
activesupport (>= 3.0, < 4.3)
|
||||
railties (>= 3.0, < 4.3)
|
||||
rspec-core (~> 3.4.0)
|
||||
rspec-expectations (~> 3.4.0)
|
||||
rspec-mocks (~> 3.4.0)
|
||||
rspec-support (~> 3.4.0)
|
||||
rspec-support (3.4.1)
|
||||
ruby_parser (3.8.1)
|
||||
sexp_processor (~> 4.1)
|
||||
rubyzip (1.2.0)
|
||||
sass (3.4.21)
|
||||
sass-rails (5.0.4)
|
||||
railties (>= 4.0.0, < 5.0)
|
||||
sass (~> 3.1)
|
||||
sprockets (>= 2.8, < 4.0)
|
||||
sprockets-rails (>= 2.0, < 4.0)
|
||||
tilt (>= 1.1, < 3)
|
||||
selectize-rails (0.12.1)
|
||||
selenium-webdriver (2.53.0)
|
||||
childprocess (~> 0.5)
|
||||
rubyzip (~> 1.0)
|
||||
websocket (~> 1.0)
|
||||
sexp_processor (4.7.0)
|
||||
shellany (0.0.1)
|
||||
simple_form (3.2.1)
|
||||
actionpack (> 4, < 5.1)
|
||||
activemodel (> 4, < 5.1)
|
||||
slop (3.6.0)
|
||||
spring (1.6.4)
|
||||
spring-commands-rspec (1.0.4)
|
||||
spring (>= 0.9.1)
|
||||
sprockets (3.5.2)
|
||||
concurrent-ruby (~> 1.0)
|
||||
rack (> 1, < 3)
|
||||
sprockets-rails (3.0.4)
|
||||
actionpack (>= 4.0)
|
||||
activesupport (>= 4.0)
|
||||
sprockets (>= 3.0.0)
|
||||
sqlite3 (1.3.11)
|
||||
sshkit (1.9.0)
|
||||
net-scp (>= 1.1.2)
|
||||
net-ssh (>= 2.8.0)
|
||||
thor (0.19.1)
|
||||
thread_safe (0.3.5)
|
||||
tilt (2.0.2)
|
||||
turbolinks (2.5.3)
|
||||
coffee-rails
|
||||
tzinfo (1.2.2)
|
||||
thread_safe (~> 0.1)
|
||||
uglifier (2.7.2)
|
||||
execjs (>= 0.3.0)
|
||||
json (>= 1.8.0)
|
||||
warden (1.2.6)
|
||||
rack (>= 1.0)
|
||||
web-console (2.3.0)
|
||||
activemodel (>= 4.0)
|
||||
binding_of_caller (>= 0.7.2)
|
||||
railties (>= 4.0)
|
||||
sprockets-rails (>= 2.0, < 4.0)
|
||||
websocket (1.2.2)
|
||||
xpath (2.0.0)
|
||||
nokogiri (~> 1.3)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
administrate
|
||||
better_errors
|
||||
bootstrap-sass
|
||||
byebug
|
||||
capistrano (~> 3.0.1)
|
||||
capistrano-bundler
|
||||
capistrano-rails (~> 1.1.0)
|
||||
capistrano-rails-console
|
||||
capistrano-rvm (~> 0.1.1)
|
||||
capybara
|
||||
coffee-rails (~> 4.1.0)
|
||||
database_cleaner
|
||||
devise
|
||||
devise_invitable
|
||||
factory_girl_rails
|
||||
faker
|
||||
guard-bundler
|
||||
guard-rails
|
||||
guard-rspec
|
||||
haml-rails
|
||||
high_voltage
|
||||
html2haml
|
||||
hub
|
||||
jbuilder (~> 2.0)
|
||||
jquery-rails
|
||||
launchy
|
||||
puma
|
||||
pundit
|
||||
quiet_assets
|
||||
rails (= 4.2.6)
|
||||
rails_apps_pages
|
||||
rails_apps_testing
|
||||
rails_layout
|
||||
rb-fchange
|
||||
rb-fsevent
|
||||
rb-inotify
|
||||
rspec-rails
|
||||
sass-rails (~> 5.0)
|
||||
selenium-webdriver
|
||||
simple_form
|
||||
spring
|
||||
spring-commands-rspec
|
||||
sqlite3
|
||||
turbolinks
|
||||
uglifier (>= 1.3.0)
|
||||
web-console (~> 2.0)
|
||||
|
||||
BUNDLED WITH
|
||||
1.11.2
|
|
@ -0,0 +1,165 @@
|
|||
# Use this setup block to configure all options available in SimpleForm.
|
||||
SimpleForm.setup do |config|
|
||||
# Wrappers are used by the form builder to generate a
|
||||
# complete input. You can remove any component from the
|
||||
# wrapper, change the order or even add your own to the
|
||||
# stack. The options given below are used to wrap the
|
||||
# whole input.
|
||||
config.wrappers :default, class: :input,
|
||||
hint_class: :field_with_hint, error_class: :field_with_errors do |b|
|
||||
## Extensions enabled by default
|
||||
# Any of these extensions can be disabled for a
|
||||
# given input by passing: `f.input EXTENSION_NAME => false`.
|
||||
# You can make any of these extensions optional by
|
||||
# renaming `b.use` to `b.optional`.
|
||||
|
||||
# Determines whether to use HTML5 (:email, :url, ...)
|
||||
# and required attributes
|
||||
b.use :html5
|
||||
|
||||
# Calculates placeholders automatically from I18n
|
||||
# You can also pass a string as f.input placeholder: "Placeholder"
|
||||
b.use :placeholder
|
||||
|
||||
## Optional extensions
|
||||
# They are disabled unless you pass `f.input EXTENSION_NAME => true`
|
||||
# to the input. If so, they will retrieve the values from the model
|
||||
# if any exists. If you want to enable any of those
|
||||
# extensions by default, you can change `b.optional` to `b.use`.
|
||||
|
||||
# Calculates maxlength from length validations for string inputs
|
||||
b.optional :maxlength
|
||||
|
||||
# Calculates pattern from format validations for string inputs
|
||||
b.optional :pattern
|
||||
|
||||
# Calculates min and max from length validations for numeric inputs
|
||||
b.optional :min_max
|
||||
|
||||
# Calculates readonly automatically from readonly attributes
|
||||
b.optional :readonly
|
||||
|
||||
## Inputs
|
||||
b.use :label_input
|
||||
b.use :hint, wrap_with: { tag: :span, class: :hint }
|
||||
b.use :error, wrap_with: { tag: :span, class: :error }
|
||||
|
||||
## full_messages_for
|
||||
# If you want to display the full error message for the attribute, you can
|
||||
# use the component :full_error, like:
|
||||
#
|
||||
# b.use :full_error, wrap_with: { tag: :span, class: :error }
|
||||
end
|
||||
|
||||
# The default wrapper to be used by the FormBuilder.
|
||||
config.default_wrapper = :default
|
||||
|
||||
# Define the way to render check boxes / radio buttons with labels.
|
||||
# Defaults to :nested for bootstrap config.
|
||||
# inline: input + label
|
||||
# nested: label > input
|
||||
config.boolean_style = :nested
|
||||
|
||||
# Default class for buttons
|
||||
config.button_class = 'btn'
|
||||
|
||||
# Method used to tidy up errors. Specify any Rails Array method.
|
||||
# :first lists the first message for each field.
|
||||
# Use :to_sentence to list all errors for each field.
|
||||
# config.error_method = :first
|
||||
|
||||
# Default tag used for error notification helper.
|
||||
config.error_notification_tag = :div
|
||||
|
||||
# CSS class to add for error notification helper.
|
||||
config.error_notification_class = 'error_notification'
|
||||
|
||||
# ID to add for error notification helper.
|
||||
# config.error_notification_id = nil
|
||||
|
||||
# Series of attempts to detect a default label method for collection.
|
||||
# config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
|
||||
|
||||
# Series of attempts to detect a default value method for collection.
|
||||
# config.collection_value_methods = [ :id, :to_s ]
|
||||
|
||||
# You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
|
||||
# config.collection_wrapper_tag = nil
|
||||
|
||||
# You can define the class to use on all collection wrappers. Defaulting to none.
|
||||
# config.collection_wrapper_class = nil
|
||||
|
||||
# You can wrap each item in a collection of radio/check boxes with a tag,
|
||||
# defaulting to :span.
|
||||
# config.item_wrapper_tag = :span
|
||||
|
||||
# You can define a class to use in all item wrappers. Defaulting to none.
|
||||
# config.item_wrapper_class = nil
|
||||
|
||||
# How the label text should be generated altogether with the required text.
|
||||
# config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" }
|
||||
|
||||
# You can define the class to use on all labels. Default is nil.
|
||||
# config.label_class = nil
|
||||
|
||||
# You can define the default class to be used on forms. Can be overriden
|
||||
# with `html: { :class }`. Defaulting to none.
|
||||
# config.default_form_class = nil
|
||||
|
||||
# You can define which elements should obtain additional classes
|
||||
# config.generate_additional_classes_for = [:wrapper, :label, :input]
|
||||
|
||||
# Whether attributes are required by default (or not). Default is true.
|
||||
# config.required_by_default = true
|
||||
|
||||
# Tell browsers whether to use the native HTML5 validations (novalidate form option).
|
||||
# These validations are enabled in SimpleForm's internal config but disabled by default
|
||||
# in this configuration, which is recommended due to some quirks from different browsers.
|
||||
# To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
|
||||
# change this configuration to true.
|
||||
config.browser_validations = false
|
||||
|
||||
# Collection of methods to detect if a file type was given.
|
||||
# config.file_methods = [ :mounted_as, :file?, :public_filename ]
|
||||
|
||||
# Custom mappings for input types. This should be a hash containing a regexp
|
||||
# to match as key, and the input type that will be used when the field name
|
||||
# matches the regexp as value.
|
||||
# config.input_mappings = { /count/ => :integer }
|
||||
|
||||
# Custom wrappers for input types. This should be a hash containing an input
|
||||
# type as key and the wrapper that will be used for all inputs with specified type.
|
||||
# config.wrapper_mappings = { string: :prepend }
|
||||
|
||||
# Namespaces where SimpleForm should look for custom input classes that
|
||||
# override default inputs.
|
||||
# config.custom_inputs_namespaces << "CustomInputs"
|
||||
|
||||
# Default priority for time_zone inputs.
|
||||
# config.time_zone_priority = nil
|
||||
|
||||
# Default priority for country inputs.
|
||||
# config.country_priority = nil
|
||||
|
||||
# When false, do not use translations for labels.
|
||||
# config.translate_labels = true
|
||||
|
||||
# Automatically discover new inputs in Rails' autoload path.
|
||||
# config.inputs_discovery = true
|
||||
|
||||
# Cache SimpleForm inputs discovery
|
||||
# config.cache_discovery = !Rails.env.development?
|
||||
|
||||
# Default class for inputs
|
||||
# config.input_class = nil
|
||||
|
||||
# Define the default class of the input wrapper of the boolean input.
|
||||
config.boolean_label_class = 'checkbox'
|
||||
|
||||
# Defines if the default input wrapper class should be included in radio
|
||||
# collection wrappers.
|
||||
# config.include_default_input_wrapper_class = true
|
||||
|
||||
# Defines which i18n scope will be used in Simple Form.
|
||||
# config.i18n_scope = 'simple_form'
|
||||
end
|
|
@ -0,0 +1,149 @@
|
|||
# Use this setup block to configure all options available in SimpleForm.
|
||||
SimpleForm.setup do |config|
|
||||
config.error_notification_class = 'alert alert-danger'
|
||||
config.button_class = 'btn btn-default'
|
||||
config.boolean_label_class = nil
|
||||
|
||||
config.wrappers :vertical_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
|
||||
b.use :html5
|
||||
b.use :placeholder
|
||||
b.optional :maxlength
|
||||
b.optional :pattern
|
||||
b.optional :min_max
|
||||
b.optional :readonly
|
||||
b.use :label, class: 'control-label'
|
||||
|
||||
b.use :input, class: 'form-control'
|
||||
b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
|
||||
b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
|
||||
end
|
||||
|
||||
config.wrappers :vertical_file_input, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
|
||||
b.use :html5
|
||||
b.use :placeholder
|
||||
b.optional :maxlength
|
||||
b.optional :readonly
|
||||
b.use :label, class: 'control-label'
|
||||
|
||||
b.use :input
|
||||
b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
|
||||
b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
|
||||
end
|
||||
|
||||
config.wrappers :vertical_boolean, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
|
||||
b.use :html5
|
||||
b.optional :readonly
|
||||
|
||||
b.wrapper tag: 'div', class: 'checkbox' do |ba|
|
||||
ba.use :label_input
|
||||
end
|
||||
|
||||
b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
|
||||
b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
|
||||
end
|
||||
|
||||
config.wrappers :vertical_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
|
||||
b.use :html5
|
||||
b.optional :readonly
|
||||
b.use :label, class: 'control-label'
|
||||
b.use :input
|
||||
b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
|
||||
b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
|
||||
end
|
||||
|
||||
config.wrappers :horizontal_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
|
||||
b.use :html5
|
||||
b.use :placeholder
|
||||
b.optional :maxlength
|
||||
b.optional :pattern
|
||||
b.optional :min_max
|
||||
b.optional :readonly
|
||||
b.use :label, class: 'col-sm-3 control-label'
|
||||
|
||||
b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
|
||||
ba.use :input, class: 'form-control'
|
||||
ba.use :error, wrap_with: { tag: 'span', class: 'help-block' }
|
||||
ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
|
||||
end
|
||||
end
|
||||
|
||||
config.wrappers :horizontal_file_input, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
|
||||
b.use :html5
|
||||
b.use :placeholder
|
||||
b.optional :maxlength
|
||||
b.optional :readonly
|
||||
b.use :label, class: 'col-sm-3 control-label'
|
||||
|
||||
b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
|
||||
ba.use :input
|
||||
ba.use :error, wrap_with: { tag: 'span', class: 'help-block' }
|
||||
ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
|
||||
end
|
||||
end
|
||||
|
||||
config.wrappers :horizontal_boolean, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
|
||||
b.use :html5
|
||||
b.optional :readonly
|
||||
|
||||
b.wrapper tag: 'div', class: 'col-sm-offset-3 col-sm-9' do |wr|
|
||||
wr.wrapper tag: 'div', class: 'checkbox' do |ba|
|
||||
ba.use :label_input
|
||||
end
|
||||
|
||||
wr.use :error, wrap_with: { tag: 'span', class: 'help-block' }
|
||||
wr.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
|
||||
end
|
||||
end
|
||||
|
||||
config.wrappers :horizontal_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
|
||||
b.use :html5
|
||||
b.optional :readonly
|
||||
|
||||
b.use :label, class: 'col-sm-3 control-label'
|
||||
|
||||
b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
|
||||
ba.use :input
|
||||
ba.use :error, wrap_with: { tag: 'span', class: 'help-block' }
|
||||
ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
|
||||
end
|
||||
end
|
||||
|
||||
config.wrappers :inline_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
|
||||
b.use :html5
|
||||
b.use :placeholder
|
||||
b.optional :maxlength
|
||||
b.optional :pattern
|
||||
b.optional :min_max
|
||||
b.optional :readonly
|
||||
b.use :label, class: 'sr-only'
|
||||
|
||||
b.use :input, class: 'form-control'
|
||||
b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
|
||||
b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
|
||||
end
|
||||
|
||||
config.wrappers :multi_select, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
|
||||
b.use :html5
|
||||
b.optional :readonly
|
||||
b.use :label, class: 'control-label'
|
||||
b.wrapper tag: 'div', class: 'form-inline' do |ba|
|
||||
ba.use :input, class: 'form-control'
|
||||
ba.use :error, wrap_with: { tag: 'span', class: 'help-block' }
|
||||
ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
|
||||
end
|
||||
end
|
||||
# Wrappers for forms and inputs using the Bootstrap toolkit.
|
||||
# Check the Bootstrap docs (http://getbootstrap.com)
|
||||
# to learn about the different styles for forms and inputs,
|
||||
# buttons and other elements.
|
||||
config.default_wrapper = :vertical_form
|
||||
config.wrapper_mappings = {
|
||||
check_boxes: :vertical_radio_and_checkboxes,
|
||||
radio_buttons: :vertical_radio_and_checkboxes,
|
||||
file: :vertical_file_input,
|
||||
boolean: :vertical_boolean,
|
||||
datetime: :multi_select,
|
||||
date: :multi_select,
|
||||
time: :multi_select
|
||||
}
|
||||
end
|
|
@ -0,0 +1,31 @@
|
|||
en:
|
||||
simple_form:
|
||||
"yes": 'Yes'
|
||||
"no": 'No'
|
||||
required:
|
||||
text: 'required'
|
||||
mark: '*'
|
||||
# You can uncomment the line below if you need to overwrite the whole required html.
|
||||
# When using html, text and mark won't be used.
|
||||
# html: '<abbr title="required">*</abbr>'
|
||||
error_notification:
|
||||
default_message: "Please review the problems below:"
|
||||
# Examples
|
||||
# labels:
|
||||
# defaults:
|
||||
# password: 'Password'
|
||||
# user:
|
||||
# new:
|
||||
# email: 'E-mail to sign in.'
|
||||
# edit:
|
||||
# email: 'E-mail.'
|
||||
# hints:
|
||||
# defaults:
|
||||
# username: 'User name to sign in.'
|
||||
# password: 'No special characters, please.'
|
||||
# include_blanks:
|
||||
# defaults:
|
||||
# age: 'Rather not say'
|
||||
# prompts:
|
||||
# defaults:
|
||||
# age: 'Select your age'
|
|
@ -0,0 +1,10 @@
|
|||
= simple_form_for(@<%= singular_table_name %>) do |f|
|
||||
= f.error_notification
|
||||
|
||||
.form-inputs
|
||||
<%- attributes.each do |attribute| -%>
|
||||
= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %>
|
||||
<%- end -%>
|
||||
|
||||
.form-actions
|
||||
= f.button :submit
|
Loading…
Reference in New Issue