bootstrap_form 5.1.0 → 5.2.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.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +21 -8
- data/.gitignore +4 -2
- data/.rubocop.yml +2 -1
- data/.yarnrc +5 -0
- data/CHANGELOG.md +13 -3
- data/CONTRIBUTING.md +101 -14
- data/Dangerfile +4 -4
- data/Dockerfile +5 -5
- data/Gemfile +5 -21
- data/README.md +108 -42
- data/RELEASING.md +12 -1
- data/Rakefile +7 -6
- data/bootstrap_form.gemspec +6 -8
- data/docker-compose.yml +6 -24
- data/gemfiles/6.0.gemfile +1 -1
- data/gemfiles/6.1.gemfile +1 -1
- data/gemfiles/7.0.gemfile +2 -3
- data/gemfiles/common.gemfile +28 -0
- data/gemfiles/edge.gemfile +3 -2
- data/lib/bootstrap_form/components/labels.rb +3 -9
- data/lib/bootstrap_form/components/validation.rb +36 -19
- data/lib/bootstrap_form/form_builder.rb +4 -1
- data/lib/bootstrap_form/form_group.rb +9 -6
- data/lib/bootstrap_form/form_group_builder.rb +10 -7
- data/lib/bootstrap_form/helpers/bootstrap.rb +7 -8
- data/lib/bootstrap_form/helpers/field.rb +26 -0
- data/lib/bootstrap_form/helpers.rb +1 -0
- data/lib/bootstrap_form/inputs/base.rb +2 -2
- data/lib/bootstrap_form/inputs/check_box.rb +22 -6
- data/lib/bootstrap_form/inputs/radio_button.rb +3 -3
- data/lib/bootstrap_form/inputs/range_field.rb +1 -1
- data/lib/bootstrap_form/inputs.rb +1 -1
- data/lib/bootstrap_form/version.rb +2 -1
- data/lib/bootstrap_form.rb +1 -1
- metadata +14 -146
- data/demo/.postcssrc.yml +0 -3
- data/demo/.ruby-version +0 -1
- data/demo/Gemfile +0 -80
- data/demo/Gemfile.lock +0 -261
- data/demo/Procfile.dev +0 -2
- data/demo/README.md +0 -17
- data/demo/Rakefile +0 -6
- data/demo/app/assets/builds/.keep +0 -0
- data/demo/app/assets/builds/application.js.LICENSE.txt +0 -9
- data/demo/app/assets/config/manifest.js +0 -2
- data/demo/app/assets/stylesheets/actiontext.css +0 -31
- data/demo/app/assets/stylesheets/actiontext.scss +0 -38
- data/demo/app/assets/stylesheets/application.scss +0 -1
- data/demo/app/controllers/application_controller.rb +0 -2
- data/demo/app/controllers/bootstrap_controller.rb +0 -29
- data/demo/app/controllers/users_controller.rb +0 -9
- data/demo/app/helpers/bootstrap_helper.rb +0 -27
- data/demo/app/javascript/application.js +0 -3
- data/demo/app/javascript/channels/consumer.js +0 -6
- data/demo/app/javascript/channels/index.js +0 -5
- data/demo/app/javascript/packs/application.js +0 -11
- data/demo/app/models/address.rb +0 -3
- data/demo/app/models/application_record.rb +0 -3
- data/demo/app/models/faux_user.rb +0 -9
- data/demo/app/models/skill.rb +0 -15
- data/demo/app/models/super_user.rb +0 -2
- data/demo/app/models/user.rb +0 -25
- data/demo/app/views/active_storage/blobs/_blob.html.erb +0 -14
- data/demo/app/views/bootstrap/form.html.erb +0 -67
- data/demo/app/views/layouts/action_text/contents/_content.html.erb +0 -3
- data/demo/app/views/layouts/application.html.erb +0 -76
- data/demo/bin/bundle +0 -3
- data/demo/bin/dev +0 -9
- data/demo/bin/rails +0 -4
- data/demo/bin/rake +0 -4
- data/demo/bin/setup +0 -36
- data/demo/bin/update +0 -31
- data/demo/bin/webpack +0 -15
- data/demo/bin/webpack-dev-server +0 -15
- data/demo/bin/yarn +0 -11
- data/demo/config/application.rb +0 -21
- data/demo/config/boot.rb +0 -5
- data/demo/config/database.yml +0 -21
- data/demo/config/environment.rb +0 -5
- data/demo/config/environments/development.rb +0 -60
- data/demo/config/environments/production.rb +0 -48
- data/demo/config/environments/test.rb +0 -46
- data/demo/config/initializers/application_controller_renderer.rb +0 -8
- data/demo/config/initializers/backtrace_silencers.rb +0 -7
- data/demo/config/initializers/cookies_serializer.rb +0 -5
- data/demo/config/initializers/filter_parameter_logging.rb +0 -4
- data/demo/config/initializers/inflections.rb +0 -16
- data/demo/config/initializers/mime_types.rb +0 -4
- data/demo/config/initializers/wrap_parameters.rb +0 -14
- data/demo/config/locales/en.yml +0 -33
- data/demo/config/puma.rb +0 -56
- data/demo/config/routes.rb +0 -6
- data/demo/config/spring.rb +0 -6
- data/demo/config/storage.yml +0 -35
- data/demo/config/webpack/development.js +0 -5
- data/demo/config/webpack/environment.js +0 -3
- data/demo/config/webpack/production.js +0 -5
- data/demo/config/webpack/test.js +0 -5
- data/demo/config/webpacker.yml +0 -92
- data/demo/config.ru +0 -5
- data/demo/db/schema.rb +0 -84
- data/demo/doc/screenshots/bootstrap/index/00_horizontal_form.png +0 -0
- data/demo/doc/screenshots/bootstrap/index/01_with_validation_error.png +0 -0
- data/demo/doc/screenshots/bootstrap/index/02_inline_form.png +0 -0
- data/demo/doc/screenshots/bootstrap/index/03_simple_action_text_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/index/04_floating_labels.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/00_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/01_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/02_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/03_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/04_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/05_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/06_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/07_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/08_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/09_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/10_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/11_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/12_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/13_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/14_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/15_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/16_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/17_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/18_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/19_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/20_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/21_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/22_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/23_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/24_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/25_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/26_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/27_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/28_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/29_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/30_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/31_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/32_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/33_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/34_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/35_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/36_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/37_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/38_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/39_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/40_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/41_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/42_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/43_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/44_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/45_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/46_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/47_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/48_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/49_example.png +0 -0
- data/demo/doc/screenshots/bootstrap/readme/50_example.png +0 -0
- data/demo/log/.keep +0 -0
- data/demo/package.json +0 -21
- data/demo/public/favicon.ico +0 -0
- data/demo/test/application_system_test_case.rb +0 -8
- data/demo/test/controllers/bootstrap_controller_test.rb +0 -8
- data/demo/test/controllers/users_controller_test.rb +0 -13
- data/demo/test/fixtures/action_text/rich_texts.yml +0 -4
- data/demo/test/fixtures/users.yml +0 -2
- data/demo/test/system/bootstrap_test.rb +0 -84
- data/demo/test/test_helper.rb +0 -10
- data/demo/webpack.config.js +0 -20
- data/demo/yarn.lock +0 -7176
- data/gemfiles/5.2.gemfile +0 -4
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
<h3>Horizontal Form</h3>
|
|
2
|
-
|
|
3
|
-
<%= form_with_source do %>
|
|
4
|
-
<%= bootstrap_form_with model: @user, layout: :horizontal, local: true do |form| %>
|
|
5
|
-
<%= form.email_field :email, placeholder: "Enter Email", label: "Email address", help: "We'll never share your email with anyone else" %>
|
|
6
|
-
<%= form.password_field :password, placeholder: "Password" %>
|
|
7
|
-
<%= form.select :status, [['activated', 1], ['blocked', 2]], prompt: "Please Select" %>
|
|
8
|
-
<%= form.text_area :misc %>
|
|
9
|
-
<%= form.check_box :terms, label: "Agree to Terms" %>
|
|
10
|
-
<%= form.collection_check_boxes :misc, @collection, :id, :street %>
|
|
11
|
-
<%= form.collection_radio_buttons :misc, @collection, :id, :street %>
|
|
12
|
-
<%= form.file_field :misc %>
|
|
13
|
-
<%= form.datetime_select :misc, include_blank: true %>
|
|
14
|
-
|
|
15
|
-
<%= form.submit %>
|
|
16
|
-
<% end %>
|
|
17
|
-
<% end %>
|
|
18
|
-
|
|
19
|
-
<h3>With Validation Error</h3>
|
|
20
|
-
|
|
21
|
-
<%= form_with_source do %>
|
|
22
|
-
<%= bootstrap_form_for @user_with_error, layout: :horizontal do |form| %>
|
|
23
|
-
<%= form.alert_message "This is an alert" %>
|
|
24
|
-
<%= form.error_summary %>
|
|
25
|
-
<%= form.email_field :email, placeholder: "Enter Email", label: "Email address", help: "We'll never share your email with anyone else" %>
|
|
26
|
-
<%= form.collection_check_boxes :misc, @collection, :id, :street %>
|
|
27
|
-
<%= form.submit %>
|
|
28
|
-
<% end %>
|
|
29
|
-
<% end %>
|
|
30
|
-
|
|
31
|
-
<h3>Inline Form</h3>
|
|
32
|
-
|
|
33
|
-
<%= form_with_source do %>
|
|
34
|
-
<%= bootstrap_form_for @user, layout: :inline do |form| %>
|
|
35
|
-
<%= form.email_field :email, placeholder: "Enter Email", label: "Email address", help: "We'll never share your email with anyone else" %>
|
|
36
|
-
<%= form.password_field :password, placeholder: "Password" %>
|
|
37
|
-
<%= form.check_box :terms, label: "Agree to Terms" %>
|
|
38
|
-
<%= form.collection_check_boxes :misc, @collection, :id, :street %>
|
|
39
|
-
<%= form.submit %>
|
|
40
|
-
<% end %>
|
|
41
|
-
<% end %>
|
|
42
|
-
|
|
43
|
-
<h3>Simple Action Text Example</h3>
|
|
44
|
-
|
|
45
|
-
<%= form_with_source do %>
|
|
46
|
-
<%= bootstrap_form_for @user, url: "/" do |form| %>
|
|
47
|
-
<%= form.email_field :email, placeholder: "Enter Email", label: "Email address", help: "We'll never share your email with anyone else" %>
|
|
48
|
-
<%= form.password_field :password, placeholder: "Password" %>
|
|
49
|
-
<%= form.check_box :terms, label: "Agree to Terms" %>
|
|
50
|
-
<%= form.collection_check_boxes :misc, @collection, :id, :street %>
|
|
51
|
-
<%= form.rich_text_area(:life_story) if Rails::VERSION::STRING > "6" %>
|
|
52
|
-
<%= form.submit %>
|
|
53
|
-
<% end %>
|
|
54
|
-
<% end %>
|
|
55
|
-
|
|
56
|
-
<h3>Floating Labels</h3>
|
|
57
|
-
|
|
58
|
-
<%= form_with_source do %>
|
|
59
|
-
<%= bootstrap_form_for @user do |form| %>
|
|
60
|
-
<%= form.email_field :email, placeholder: "Enter Email", label: "Email address", help: "We'll never share your email with anyone else", floating: true %>
|
|
61
|
-
<%= form.password_field :password, placeholder: "Password", floating: true %>
|
|
62
|
-
<%= form.text_field :misc, floating: true %>
|
|
63
|
-
<%= form.text_area :comments, floating: true %>
|
|
64
|
-
<%= form.select :status, [["Active", 1], ["Inactive", 2]], include_blank: "Select a value", floating: true %>
|
|
65
|
-
<%= form.submit %>
|
|
66
|
-
<% end %>
|
|
67
|
-
<% end %>
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<!-- Required meta tags -->
|
|
5
|
-
<meta charset="utf-8">
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
7
|
-
|
|
8
|
-
<!-- Bootstrap CSS -->
|
|
9
|
-
<!-- CSS only -->
|
|
10
|
-
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
|
|
11
|
-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.33.0/codemirror.min.css">
|
|
12
|
-
|
|
13
|
-
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
|
|
14
|
-
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload', defer: true %>
|
|
15
|
-
|
|
16
|
-
<style type="text/css">
|
|
17
|
-
.example {
|
|
18
|
-
padding: 1.5em;
|
|
19
|
-
border: .2rem solid #f7f7f9;
|
|
20
|
-
margin-bottom: 3em;
|
|
21
|
-
}
|
|
22
|
-
.toggle {
|
|
23
|
-
margin-top: 1.5em;
|
|
24
|
-
}
|
|
25
|
-
.code {
|
|
26
|
-
margin-top: 1rem;
|
|
27
|
-
}
|
|
28
|
-
.CodeMirror {
|
|
29
|
-
border: 1px solid #eee;
|
|
30
|
-
height: auto;
|
|
31
|
-
}
|
|
32
|
-
.rails-bootstrap-forms-datetime-select select {
|
|
33
|
-
display: inline-block;
|
|
34
|
-
width: auto;
|
|
35
|
-
}
|
|
36
|
-
</style>
|
|
37
|
-
|
|
38
|
-
<title>Hello, world!</title>
|
|
39
|
-
<%= csrf_meta_tags %>
|
|
40
|
-
<%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>
|
|
41
|
-
</head>
|
|
42
|
-
|
|
43
|
-
<body>
|
|
44
|
-
<div class="container">
|
|
45
|
-
<%= yield %>
|
|
46
|
-
</div>
|
|
47
|
-
|
|
48
|
-
<!-- Optional JavaScript -->
|
|
49
|
-
<!-- JavaScript Bundle with Popper -->
|
|
50
|
-
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
|
|
51
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.33.0/codemirror.min.js"></script>
|
|
52
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.33.0/mode/htmlmixed/htmlmixed.min.js"></script>
|
|
53
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.33.0/mode/xml/xml.min.js"></script>
|
|
54
|
-
|
|
55
|
-
<script type="text/javascript">
|
|
56
|
-
const buttons = document.querySelectorAll('button.toggle');
|
|
57
|
-
const buttonsArray = Array.prototype.slice.call(buttons);
|
|
58
|
-
buttonsArray.forEach(function(elem) {
|
|
59
|
-
elem.addEventListener('click', function() {
|
|
60
|
-
const example = this.closest('.example');
|
|
61
|
-
if (example.querySelector('.code').style.display === "block") {
|
|
62
|
-
example.querySelector('.code').style.display = "none";
|
|
63
|
-
} else {
|
|
64
|
-
example.querySelector('.code').style.display = "block";
|
|
65
|
-
}
|
|
66
|
-
CodeMirror.fromTextArea(example.querySelector('textarea.codemirror'), {
|
|
67
|
-
mode: 'htmlmixed',
|
|
68
|
-
tabSize: 2,
|
|
69
|
-
lineNumbers: true,
|
|
70
|
-
viewportMargin: Infinity,
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
</script>
|
|
75
|
-
</body>
|
|
76
|
-
</html>
|
data/demo/bin/bundle
DELETED
data/demo/bin/dev
DELETED
data/demo/bin/rails
DELETED
data/demo/bin/rake
DELETED
data/demo/bin/setup
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
require "fileutils"
|
|
3
|
-
include FileUtils
|
|
4
|
-
|
|
5
|
-
# path to your application root.
|
|
6
|
-
APP_ROOT = File.expand_path("..", __dir__)
|
|
7
|
-
|
|
8
|
-
def system!(*args)
|
|
9
|
-
system(*args) || abort("\n== Command #{args} failed ==")
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
chdir APP_ROOT do
|
|
13
|
-
# This script is a starting point to setup your application.
|
|
14
|
-
# Add necessary setup steps to this file.
|
|
15
|
-
|
|
16
|
-
puts "== Installing dependencies =="
|
|
17
|
-
system! "gem install bundler --conservative"
|
|
18
|
-
system("bundle check") || system!("bundle install")
|
|
19
|
-
|
|
20
|
-
# Install JavaScript dependencies if using Yarn
|
|
21
|
-
# system('bin/yarn')
|
|
22
|
-
|
|
23
|
-
# puts "\n== Copying sample files =="
|
|
24
|
-
# unless File.exist?('config/database.yml')
|
|
25
|
-
# cp 'config/database.yml.sample', 'config/database.yml'
|
|
26
|
-
# end
|
|
27
|
-
|
|
28
|
-
puts "\n== Preparing database =="
|
|
29
|
-
system! "bin/rails db:setup"
|
|
30
|
-
|
|
31
|
-
puts "\n== Removing old logs and tempfiles =="
|
|
32
|
-
system! "bin/rails log:clear tmp:clear"
|
|
33
|
-
|
|
34
|
-
puts "\n== Restarting application server =="
|
|
35
|
-
system! "bin/rails restart"
|
|
36
|
-
end
|
data/demo/bin/update
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
require "fileutils"
|
|
3
|
-
include FileUtils
|
|
4
|
-
|
|
5
|
-
# path to your application root.
|
|
6
|
-
APP_ROOT = File.expand_path("..", __dir__)
|
|
7
|
-
|
|
8
|
-
def system!(*args)
|
|
9
|
-
system(*args) || abort("\n== Command #{args} failed ==")
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
chdir APP_ROOT do
|
|
13
|
-
# This script is a way to update your development environment automatically.
|
|
14
|
-
# Add necessary update steps to this file.
|
|
15
|
-
|
|
16
|
-
puts "== Installing dependencies =="
|
|
17
|
-
system! "gem install bundler --conservative"
|
|
18
|
-
system("bundle check") || system!("bundle install")
|
|
19
|
-
|
|
20
|
-
# Install JavaScript dependencies if using Yarn
|
|
21
|
-
# system('bin/yarn')
|
|
22
|
-
|
|
23
|
-
puts "\n== Updating database =="
|
|
24
|
-
system! "bin/rails db:migrate"
|
|
25
|
-
|
|
26
|
-
puts "\n== Removing old logs and tempfiles =="
|
|
27
|
-
system! "bin/rails log:clear tmp:clear"
|
|
28
|
-
|
|
29
|
-
puts "\n== Restarting application server =="
|
|
30
|
-
system! "bin/rails restart"
|
|
31
|
-
end
|
data/demo/bin/webpack
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
|
|
3
|
-
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
|
|
4
|
-
ENV["NODE_ENV"] ||= "development"
|
|
5
|
-
|
|
6
|
-
require "pathname"
|
|
7
|
-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
8
|
-
Pathname.new(__FILE__).realpath)
|
|
9
|
-
|
|
10
|
-
require "rubygems"
|
|
11
|
-
require "bundler/setup"
|
|
12
|
-
|
|
13
|
-
require "webpacker"
|
|
14
|
-
require "webpacker/webpack_runner"
|
|
15
|
-
Webpacker::WebpackRunner.run(ARGV)
|
data/demo/bin/webpack-dev-server
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
|
|
3
|
-
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
|
|
4
|
-
ENV["NODE_ENV"] ||= "development"
|
|
5
|
-
|
|
6
|
-
require "pathname"
|
|
7
|
-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
8
|
-
Pathname.new(__FILE__).realpath)
|
|
9
|
-
|
|
10
|
-
require "rubygems"
|
|
11
|
-
require "bundler/setup"
|
|
12
|
-
|
|
13
|
-
require "webpacker"
|
|
14
|
-
require "webpacker/dev_server_runner"
|
|
15
|
-
Webpacker::DevServerRunner.run(ARGV)
|
data/demo/bin/yarn
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
APP_ROOT = File.expand_path("..", __dir__)
|
|
3
|
-
Dir.chdir(APP_ROOT) do
|
|
4
|
-
begin
|
|
5
|
-
exec "yarnpkg #{ARGV.join(' ')}"
|
|
6
|
-
rescue Errno::ENOENT
|
|
7
|
-
warn "Yarn executable was not detected in the system."
|
|
8
|
-
warn "Download Yarn at https://yarnpkg.com/en/docs/install"
|
|
9
|
-
exit 1
|
|
10
|
-
end
|
|
11
|
-
end
|
data/demo/config/application.rb
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
require_relative "boot"
|
|
2
|
-
|
|
3
|
-
require "rails/all"
|
|
4
|
-
|
|
5
|
-
Bundler.require(*Rails.groups)
|
|
6
|
-
require "bootstrap_form"
|
|
7
|
-
|
|
8
|
-
module Dummy
|
|
9
|
-
class Application < Rails::Application
|
|
10
|
-
# Initialize configuration defaults for originally generated Rails version.
|
|
11
|
-
|
|
12
|
-
config.respond_to?(:load_defaults) &&
|
|
13
|
-
config.load_defaults([Rails::VERSION::MAJOR, Rails::VERSION::MINOR].join("."))
|
|
14
|
-
|
|
15
|
-
config.secret_key_base = "ignore" if config.respond_to?(:secret_key_base)
|
|
16
|
-
|
|
17
|
-
# Settings in config/environments/* take precedence over those specified here.
|
|
18
|
-
# Application configuration should go into files in config/initializers
|
|
19
|
-
# -- all .rb files in that directory are automatically loaded.
|
|
20
|
-
end
|
|
21
|
-
end
|
data/demo/config/boot.rb
DELETED
data/demo/config/database.yml
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# SQLite version 3.x
|
|
2
|
-
# gem install sqlite3
|
|
3
|
-
#
|
|
4
|
-
# Ensure the SQLite 3 gem is defined in your Gemfile
|
|
5
|
-
# gem 'sqlite3'
|
|
6
|
-
#
|
|
7
|
-
default: &default
|
|
8
|
-
adapter: sqlite3
|
|
9
|
-
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
|
10
|
-
timeout: 5000
|
|
11
|
-
|
|
12
|
-
development:
|
|
13
|
-
<<: *default
|
|
14
|
-
database: db/development.sqlite3
|
|
15
|
-
|
|
16
|
-
# Warning: The database defined as "test" will be erased and
|
|
17
|
-
# re-generated from your development database when you run "rake".
|
|
18
|
-
# Do not set this db to the same as development or production.
|
|
19
|
-
test:
|
|
20
|
-
<<: *default
|
|
21
|
-
database: db/test.sqlite3
|
data/demo/config/environment.rb
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
Rails.application.configure do
|
|
2
|
-
# Verifies that versions and hashed value of the package contents in the project's package.json
|
|
3
|
-
# config.webpacker.check_yarn_integrity = true
|
|
4
|
-
# Settings specified here will take precedence over those in config/application.rb.
|
|
5
|
-
|
|
6
|
-
# In the development environment your application's code is reloaded on
|
|
7
|
-
# every request. This slows down response time but is perfect for development
|
|
8
|
-
# since you don't have to restart the web server when you make code changes.
|
|
9
|
-
config.cache_classes = false
|
|
10
|
-
|
|
11
|
-
# Do not eager load code on boot.
|
|
12
|
-
config.eager_load = false
|
|
13
|
-
|
|
14
|
-
# Show full error reports.
|
|
15
|
-
config.consider_all_requests_local = true
|
|
16
|
-
|
|
17
|
-
# Enable/disable caching. By default caching is disabled.
|
|
18
|
-
# Run rails dev:cache to toggle caching.
|
|
19
|
-
if Rails.root.join("tmp/caching-dev.txt").exist?
|
|
20
|
-
config.action_controller.perform_caching = true
|
|
21
|
-
|
|
22
|
-
config.cache_store = :memory_store
|
|
23
|
-
config.public_file_server.headers = {
|
|
24
|
-
"Cache-Control" => "public, max-age=#{2.days.to_i}"
|
|
25
|
-
}
|
|
26
|
-
else
|
|
27
|
-
config.action_controller.perform_caching = false
|
|
28
|
-
|
|
29
|
-
config.cache_store = :null_store
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
# Store uploaded files on the local file system (see config/storage.yml for options)
|
|
33
|
-
config.active_storage.service = :local if config.respond_to?(:active_storage)
|
|
34
|
-
|
|
35
|
-
# Don't care if the mailer can't send.
|
|
36
|
-
config.action_mailer.raise_delivery_errors = false
|
|
37
|
-
|
|
38
|
-
config.action_mailer.perform_caching = false
|
|
39
|
-
|
|
40
|
-
# Print deprecation notices to the Rails logger.
|
|
41
|
-
config.active_support.deprecation = :log
|
|
42
|
-
|
|
43
|
-
# Raise an error on page load if there are pending migrations.
|
|
44
|
-
config.active_record.migration_error = :page_load
|
|
45
|
-
|
|
46
|
-
# Debug mode disables concatenation and preprocessing of assets.
|
|
47
|
-
# This option may cause significant delays in view rendering with a large
|
|
48
|
-
# number of complex assets.
|
|
49
|
-
# config.assets.debug = true
|
|
50
|
-
|
|
51
|
-
# Suppress logger output for asset requests.
|
|
52
|
-
# config.assets.quiet = true
|
|
53
|
-
|
|
54
|
-
# Raises error for missing translations
|
|
55
|
-
# config.action_view.raise_on_missing_translations = true
|
|
56
|
-
|
|
57
|
-
# Use an evented file watcher to asynchronously detect changes in source code,
|
|
58
|
-
# routes, locales, etc. This feature depends on the listen gem.
|
|
59
|
-
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
|
60
|
-
end
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
Rails.application.configure do
|
|
2
|
-
# Verifies that versions and hashed value of the package contents in the project's package.json
|
|
3
|
-
config.webpacker.check_yarn_integrity = false
|
|
4
|
-
# Settings specified here will take precedence over those in config/application.rb.
|
|
5
|
-
|
|
6
|
-
# The test environment is used exclusively to run your application's
|
|
7
|
-
# test suite. You never need to work with it otherwise. Remember that
|
|
8
|
-
# your test database is "scratch space" for the test suite and is wiped
|
|
9
|
-
# and recreated between test runs. Don't rely on the data there!
|
|
10
|
-
config.cache_classes = true
|
|
11
|
-
|
|
12
|
-
# Do not eager load code on boot. This avoids loading your whole application
|
|
13
|
-
# just for the purpose of running a single test. If you are using a tool that
|
|
14
|
-
# preloads Rails for running tests, you may have to set it to true.
|
|
15
|
-
config.eager_load = false
|
|
16
|
-
|
|
17
|
-
# Configure public file server for tests with Cache-Control for performance.
|
|
18
|
-
config.public_file_server.enabled = true
|
|
19
|
-
config.public_file_server.headers = {
|
|
20
|
-
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
# Show full error reports and disable caching.
|
|
24
|
-
config.consider_all_requests_local = true
|
|
25
|
-
config.action_controller.perform_caching = false
|
|
26
|
-
|
|
27
|
-
# Raise exceptions instead of rendering exception templates.
|
|
28
|
-
config.action_dispatch.show_exceptions = false
|
|
29
|
-
|
|
30
|
-
# Disable request forgery protection in test environment.
|
|
31
|
-
config.action_controller.allow_forgery_protection = false
|
|
32
|
-
|
|
33
|
-
# Store uploaded files on the local file system in a temporary directory
|
|
34
|
-
config.active_storage.service = :test if config.respond_to?(:active_storage)
|
|
35
|
-
|
|
36
|
-
config.action_mailer.perform_caching = false
|
|
37
|
-
|
|
38
|
-
# Tell Action Mailer not to deliver emails to the real world.
|
|
39
|
-
# The :test delivery method accumulates sent emails in the
|
|
40
|
-
# ActionMailer::Base.deliveries array.
|
|
41
|
-
config.action_mailer.delivery_method = :test
|
|
42
|
-
|
|
43
|
-
# Print deprecation notices to the stderr.
|
|
44
|
-
config.active_support.deprecation = :stderr
|
|
45
|
-
|
|
46
|
-
# Raises error for missing translations
|
|
47
|
-
# config.action_view.raise_on_missing_translations = true
|
|
48
|
-
end
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
Rails.application.configure do
|
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb.
|
|
3
|
-
|
|
4
|
-
# The test environment is used exclusively to run your application's
|
|
5
|
-
# test suite. You never need to work with it otherwise. Remember that
|
|
6
|
-
# your test database is "scratch space" for the test suite and is wiped
|
|
7
|
-
# and recreated between test runs. Don't rely on the data there!
|
|
8
|
-
config.cache_classes = true
|
|
9
|
-
|
|
10
|
-
# Do not eager load code on boot. This avoids loading your whole application
|
|
11
|
-
# just for the purpose of running a single test. If you are using a tool that
|
|
12
|
-
# preloads Rails for running tests, you may have to set it to true.
|
|
13
|
-
config.eager_load = false
|
|
14
|
-
|
|
15
|
-
# Configure public file server for tests with Cache-Control for performance.
|
|
16
|
-
config.public_file_server.enabled = true
|
|
17
|
-
config.public_file_server.headers = {
|
|
18
|
-
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
# Show full error reports and disable caching.
|
|
22
|
-
config.consider_all_requests_local = true
|
|
23
|
-
config.action_controller.perform_caching = false
|
|
24
|
-
|
|
25
|
-
# Raise exceptions instead of rendering exception templates.
|
|
26
|
-
config.action_dispatch.show_exceptions = false
|
|
27
|
-
|
|
28
|
-
# Disable request forgery protection in test environment.
|
|
29
|
-
config.action_controller.allow_forgery_protection = false
|
|
30
|
-
|
|
31
|
-
# Store uploaded files on the local file system in a temporary directory
|
|
32
|
-
config.active_storage.service = :test if config.respond_to?(:active_storage)
|
|
33
|
-
|
|
34
|
-
config.action_mailer.perform_caching = false
|
|
35
|
-
|
|
36
|
-
# Tell Action Mailer not to deliver emails to the real world.
|
|
37
|
-
# The :test delivery method accumulates sent emails in the
|
|
38
|
-
# ActionMailer::Base.deliveries array.
|
|
39
|
-
config.action_mailer.delivery_method = :test
|
|
40
|
-
|
|
41
|
-
# Print deprecation notices to the stderr.
|
|
42
|
-
config.active_support.deprecation = :stderr
|
|
43
|
-
|
|
44
|
-
# Raises error for missing translations
|
|
45
|
-
# config.action_view.raise_on_missing_translations = true
|
|
46
|
-
end
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
|
2
|
-
|
|
3
|
-
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
|
4
|
-
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
|
5
|
-
|
|
6
|
-
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
|
7
|
-
# Rails.backtrace_cleaner.remove_silencers!
|
|
@@ -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,14 +0,0 @@
|
|
|
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]
|
|
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
|
data/demo/config/locales/en.yml
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
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
|
-
# The following keys must be escaped otherwise they will not be retrieved by
|
|
20
|
-
# the default I18n backend:
|
|
21
|
-
#
|
|
22
|
-
# true, false, on, off, yes, no
|
|
23
|
-
#
|
|
24
|
-
# Instead, surround them with single quotes.
|
|
25
|
-
#
|
|
26
|
-
# en:
|
|
27
|
-
# 'true': 'foo'
|
|
28
|
-
#
|
|
29
|
-
# To learn more, please read the Rails Internationalization guide
|
|
30
|
-
# available at http://guides.rubyonrails.org/i18n.html.
|
|
31
|
-
|
|
32
|
-
en:
|
|
33
|
-
hello: "Hello world"
|