4 |
5 | <%# ALL: The challenge itself %>
6 |
7 |
8 | <% if @challenge.user.image? %>
9 | <%= image_tag "#{@challenge.user.image}" %>
10 | <% elsif @challenge.user.photo.attached? %>
11 | <%= cl_image_tag(@challenge.user.photo.key) %>
12 | <% end %>
13 |
14 |
<%= @challenge.user.nickname %>
15 |
<%= @challenge.location %>
16 |
17 |
18 |
<%= @challenge.title %>
19 |
Maximum price: €<%= @challenge.price_max %>
20 |
Deadline: <%= @challenge.deadline.strftime("%B %d, %Y") %>
21 |
Language: <%= @challenge.filter.name %>
22 |
<%= @challenge.content %>
23 | <% @challenge.photos.each do |photo| %>
24 | <%= cl_image_tag photo.key, height: 400, width: 600, crop: :fit, class:"my-1" %>
25 | <% end %>
26 |
27 | <% if policy(@challenge).edit? %>
28 | <%= link_to "Delete this challenge", challenge_path(@challenge), class: "btn btn-danger mt-5 mb-1", id: "challenge_buttons",
29 | style:"color:white; background-color:#D0021B !important; border-color:#D0021B !important;",
30 | data: { turbo_method: :delete, turbo_confirm: "Are you sure to delete this challenge?" } %>
31 | <%= link_to "Edit this challenge", edit_challenge_path(@challenge), class: "btn btn-info mt-5 mb-1", id: "challenge_buttons" %>
32 | <%= link_to "Back to Challenges", "/challenges", class:"btn btn-secondary btn mt-5 mb-1", style:"border-radius:15px" %>
33 | <% end %>
34 |
35 |
36 |
37 |
38 | <%# ONLY USERS: Form for those making an offer %>
39 | <% if current_user != @challenge.user %>
40 |
41 |
42 |
Offer your skills
43 |
Do you think you have the required skills? Let them know for how much
44 | you could do the challenge and how long it will take you:
45 | <%= simple_form_for [@challenge, @offer] do |f| %>
46 |
47 |
48 | <%= f.input :price, label: "Price, €" %>
49 |
50 |
51 | <%= f.input :date, label: 'Proposed date of completion' %>
52 |
53 |
54 |
55 | <%= f.submit "Make offer", class:"btn btn-dark btn-lg rounded-lg mt-2", id:"button" %>
56 | <% end %>
57 | <%= link_to "Back to Challenges", "/challenges", class:"btn btn-secondary btn-lg mt-2", style:"border-radius:15px" %>
58 |
59 |
60 |
61 | <% end %>
62 |
63 | <%# ONLY OWNERS: Showing the offers made and able to accept offer %>
64 | <% if current_user == @challenge.user %>
65 |
66 |
67 |
Offers
68 | <% if @offers.empty? %>
69 |
There are no offers on this challenge! Check back again later...
70 | <% else %>
71 |
109 | <% end %>
110 |
111 |
112 | <%# ALL: Comments left on the challenge %>
113 |
114 |
115 |
Comments
116 | <% if @comments.nil? %>
117 |
There are no comments on this challenge! Check back again later...
118 | <% else %>
119 |
127 | <% end %>
128 |
129 |
130 |
131 |
--------------------------------------------------------------------------------
/app/views/devise/confirmations/new.html.erb:
--------------------------------------------------------------------------------
1 |
Resend confirmation instructions
2 |
3 | <%= simple_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
4 | <%= f.error_notification %>
5 | <%= f.full_error :confirmation_token %>
6 |
7 |
8 | <%= f.input :email,
9 | required: true,
10 | autofocus: true,
11 | value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email),
12 | input_html: { autocomplete: "email" } %>
13 |
14 |
15 |
16 | <%= f.button :submit, "Resend confirmation instructions" %>
17 |
18 | <% end %>
19 |
20 | <%= render "devise/shared/links" %>
21 |
--------------------------------------------------------------------------------
/app/views/devise/mailer/confirmation_instructions.html.erb:
--------------------------------------------------------------------------------
1 |
Welcome <%= @email %>!
2 |
3 |
You can confirm your account email through the link below:
4 |
5 |
<%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %>
6 |
--------------------------------------------------------------------------------
/app/views/devise/mailer/email_changed.html.erb:
--------------------------------------------------------------------------------
1 |
Hello <%= @email %>!
2 |
3 | <% if @resource.try(:unconfirmed_email?) %>
4 |
We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.
5 | <% else %>
6 |
We're contacting you to notify you that your email has been changed to <%= @resource.email %>.
7 | <% end %>
8 |
--------------------------------------------------------------------------------
/app/views/devise/mailer/password_change.html.erb:
--------------------------------------------------------------------------------
1 |
Hello <%= @resource.email %>!
2 |
3 |
We're contacting you to notify you that your password has been changed.
4 |
--------------------------------------------------------------------------------
/app/views/devise/mailer/reset_password_instructions.html.erb:
--------------------------------------------------------------------------------
1 |
Hello <%= @resource.email %>!
2 |
3 |
Someone has requested a link to change your password. You can do this through the link below.
4 |
5 |
<%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %>
6 |
7 |
If you didn't request this, please ignore this email.
8 |
Your password won't change until you access the link above and create a new one.
9 |
--------------------------------------------------------------------------------
/app/views/devise/mailer/unlock_instructions.html.erb:
--------------------------------------------------------------------------------
1 |
Hello <%= @resource.email %>!
2 |
3 |
Your account has been locked due to an excessive number of unsuccessful sign in attempts.
4 |
5 |
Click the link below to unlock your account:
6 |
7 |
<%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %>
8 |
--------------------------------------------------------------------------------
/app/views/devise/passwords/edit.html.erb:
--------------------------------------------------------------------------------
1 |
Change your password
2 |
3 | <%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
4 | <%= f.error_notification %>
5 |
6 | <%= f.input :reset_password_token, as: :hidden %>
7 | <%= f.full_error :reset_password_token %>
8 |
9 |
10 | <%= f.input :password,
11 | label: "New password",
12 | required: true,
13 | autofocus: true,
14 | hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length),
15 | input_html: { autocomplete: "new-password" } %>
16 | <%= f.input :password_confirmation,
17 | label: "Confirm your new password",
18 | required: true,
19 | input_html: { autocomplete: "new-password" } %>
20 |
21 |
22 |
23 | <%= f.button :submit, "Change my password" %>
24 |
25 | <% end %>
26 |
27 | <%= render "devise/shared/links" %>
28 |
--------------------------------------------------------------------------------
/app/views/devise/passwords/new.html.erb:
--------------------------------------------------------------------------------
1 |
Forgot your password?
2 |
3 | <%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
4 | <%= f.error_notification %>
5 |
6 |
7 | <%= f.input :email,
8 | required: true,
9 | autofocus: true,
10 | input_html: { autocomplete: "email" } %>
11 |
12 |
13 |
14 | <%= f.button :submit, "Send me reset password instructions" %>
15 |
16 | <% end %>
17 |
18 | <%= render "devise/shared/links" %>
19 |
--------------------------------------------------------------------------------
/app/views/devise/registrations/edit.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Edit <%= resource_name.to_s.humanize %>
5 |
6 | <%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
7 | <%= f.error_notification %>
8 |
9 |
32 |
33 |
34 | <%= f.button :submit, "Update" %>
35 |
36 | <% end %>
37 |
38 |
Cancel my account
39 |
40 |
Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %>
41 |
42 | <%= link_to "Back", :back %>
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/app/views/devise/registrations/new.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | <%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), data: { turbo: :false }) do |f| %>
8 | <%= f.error_notification %>
9 | <% if false %>
10 |
11 | <%= f.hidden_field :nickname,
12 | required: false,
13 | autofocus: true,
14 | input_html: { autocomplete: "nickname" }%>
15 | <%= f.hidden_field :email,
16 | required: true,
17 | autofocus: true,
18 | input_html: { autocomplete: "email" }%>
19 | <%= f.hidden_field :location,
20 | required: false,
21 | autofocus: true,
22 | input_html: { autocomplete: "location" }%>
23 | <%= f.hidden_field :photo, as: :file %>
24 | <%= f.hidden_field :password,
25 | required: true,
26 | hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length),
27 | input_html: { autocomplete: "new-password" } %>
28 | <%= f.hidden_field :password_confirmation,
29 | required: true,
30 | input_html: { autocomplete: "new-password" } %>
31 |
32 | <% end %>
33 | <% end %>
34 | <%= render "devise/shared/links" %>
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/app/views/devise/sessions/new.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | <%= simple_form_for(resource, as: resource_name, url: session_path(resource_name), data: { turbo: :false }) do |f| %>
8 |
9 | <%= f.hidden_field :email,
10 | required: false,
11 | autofocus: true,
12 | input_html: { autocomplete: "email" } %>
13 | <%= f.hidden_field :password,
14 | required: false,
15 | input_html: { autocomplete: "current-password" } %>
16 | <%= f.hidden_field :remember_me, as: :boolean if devise_mapping.rememberable? %>
17 |
18 |
19 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/app/views/devise/shared/_error_messages.html.erb:
--------------------------------------------------------------------------------
1 | <% if resource.errors.any? %>
2 |
3 |
4 | <%= I18n.t("errors.messages.not_saved",
5 | count: resource.errors.count,
6 | resource: resource.class.model_name.human.downcase)
7 | %>
8 |
9 |
10 | <% resource.errors.full_messages.each do |message| %>
11 | <%= message %>
12 | <% end %>
13 |
14 |
15 | <% end %>
16 |
--------------------------------------------------------------------------------
/app/views/devise/shared/_links.html.erb:
--------------------------------------------------------------------------------
1 | <%- if devise_mapping.omniauthable? %>
2 | <%- resource_class.omniauth_providers.each do |provider| %>
3 | <%= button_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), data: { 'turbo-method' => :post }, class:"button draw-border mr-2 sign-in-button"%>
4 | <% end %>
5 | <% end %>
6 |
7 | <%- if controller_name != 'sessions' %>
8 | <%#= link_to "Log in", new_session_path(resource_name) %>
9 | <% end %>
10 |
11 | <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
12 | <%#= link_to "Sign up", new_registration_path(resource_name) %>
13 | <% end %>
14 |
15 | <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
16 | <%#= link_to "Forgot your password?", new_password_path(resource_name) %>
17 | <% end %>
18 |
19 | <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
20 | <%#= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
21 | <% end %>
22 |
23 | <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
24 | <%#= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
25 | <% end %>
26 |
--------------------------------------------------------------------------------
/app/views/devise/unlocks/new.html.erb:
--------------------------------------------------------------------------------
1 |
Resend unlock instructions
2 |
3 | <%= simple_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
4 | <%= f.error_notification %>
5 | <%= f.full_error :unlock_token %>
6 |
7 |
8 | <%= f.input :email,
9 | required: true,
10 | autofocus: true,
11 | input_html: { autocomplete: "email" } %>
12 |
13 |
14 |
15 | <%= f.button :submit, "Resend unlock instructions" %>
16 |
17 | <% end %>
18 |
19 | <%= render "devise/shared/links" %>
20 |
--------------------------------------------------------------------------------
/app/views/layouts/application.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | <%# class h-100 sticks the footer at the bottom %>
4 |
5 |
6 |
Dev.Work
7 |
8 | <%= csrf_meta_tags %>
9 | <%= csp_meta_tag %>
10 | <%# Bootstrap %>
11 |
12 | <%# Fontawesome %>
13 |
14 | <%# Box Icons %>
15 |
16 |
17 |
20 |
21 |
24 | <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
25 |
26 |
27 | <%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>
28 |
29 |
30 |
31 |
32 |
33 | <%#
%>
34 |
35 | <% unless current_page?(root_path) %>
36 | <%= render "shared/sidebar" %>
37 | <% end %>
38 | <%= render 'shared/flashes' %>
39 |
40 | <%= yield %>
41 |
42 |
43 |
44 | <% unless current_page?(root_path) %>
45 | <%= render "shared/footer" %>
46 | <% end %>
47 | <%#
%>
48 |
49 |
50 |
51 |
56 |
57 |
--------------------------------------------------------------------------------
/app/views/layouts/mailer.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
10 |
11 | <%= yield %>
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/views/layouts/mailer.text.erb:
--------------------------------------------------------------------------------
1 | <%= yield %>
2 |
--------------------------------------------------------------------------------
/app/views/offers/index.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 | <% @user_offers.each do |offer| %>
22 |
23 |
<%= offer.challenge.title %>
24 |
25 |
26 |
Their maximum price:
27 |
<%= offer.challenge.price_max %>
28 |
The deadline:
29 |
<%= offer.challenge.deadline %>
30 |
31 |
32 |
My offered price:
33 |
<%= offer.price %>
34 |
My proposed date:
35 |
<%= offer.date %>
36 |
37 |
38 | <%= link_to "See challenge", challenge_path(offer.challenge), class:"btn btn-dark btn-lg rounded-lg mx-3", style:"position:absolute;bottom:10px; width:180px", id:"button" %>
39 | <%= link_to "View offer", "#", class:"btn btn-dark btn-lg rounded-lg mx-3", style:"position:absolute;bottom:10px; right:0px; width:180px", id:"button" %>
40 |
41 | <% end %>
42 |
43 | <%# end %>
44 |
45 |
--------------------------------------------------------------------------------
/app/views/offers/review.html.erb:
--------------------------------------------------------------------------------
1 | <%= simple_form_for([@challenge, @offer]) do |f| %>
2 | <%= f.input :comment %>
3 | <%= f.submit %>
4 | <% end %>
5 |
--------------------------------------------------------------------------------
/app/views/offers/show.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
Details of Your Offer
6 | <%= simple_form_for @challenge do |f| %>
7 | <%= f.input :title, placeholder: 'Edit the Title' %>
8 | <%= f.input :content, placeholder: 'Edit the description' %>
9 | <%= f.input :location, placeholder: 'Edit Challenge location' %>
10 | <%= f.association :filter, label: "Programming language ¹", collection: Filter.all.order(:name), input_html: { data: { controller: "tom-select" } } %>
11 | <%= f.input :price_max, placeholder: 'Edit price of your project' %>
12 | <%= f.input :deadline, placeholder: 'Edit deadline of your project' %>
13 | <%= f.submit class:"btn btn-dark btn-lg rounded-lg", id: "challenge_buttons" %>
14 | <% end %>
15 |
16 |
17 |
18 |
* All the fields need to be present for successful update
19 |
1 You cannot change the programming language of the challenge - for that you need to create a new one
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/views/pages/home.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= render "shared/banner" %>
3 |
--------------------------------------------------------------------------------
/app/views/shared/_banner.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
DEV.WORK
5 |
Find solutions to your challenges!
6 | <%= link_to "Learn More", challenges_path, class:"btn btn-primary btn-lg mt-6 learn_more" %>
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/views/shared/_button.html.erb:
--------------------------------------------------------------------------------
1 |
Primary link
2 |
--------------------------------------------------------------------------------
/app/views/shared/_flashes.html.erb:
--------------------------------------------------------------------------------
1 | <% if notice %>
2 |
3 |
4 | <%= notice %>
5 |
6 | <% end %>
7 | <% if alert %>
8 |
9 |
10 | <%= alert %>
11 |
12 | <% end %>
13 |
--------------------------------------------------------------------------------
/app/views/shared/_footer.html.erb:
--------------------------------------------------------------------------------
1 |
49 |
--------------------------------------------------------------------------------
/app/views/shared/_navbar.html.erb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EleoXDA/Dev.Work_RB/04abd63617f115b88cbfe7fd564fc30b55e74366/app/views/shared/_navbar.html.erb
--------------------------------------------------------------------------------
/app/views/shared/_sidebar.html.erb:
--------------------------------------------------------------------------------
1 |
78 |
--------------------------------------------------------------------------------
/bin/bundle:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | # frozen_string_literal: true
3 |
4 | #
5 | # This file was generated by Bundler.
6 | #
7 | # The application 'bundle' is installed as part of a gem, and
8 | # this file is here to facilitate running it.
9 | #
10 |
11 | require "rubygems"
12 |
13 | m = Module.new do
14 | module_function
15 |
16 | def invoked_as_script?
17 | File.expand_path($0) == File.expand_path(__FILE__)
18 | end
19 |
20 | def env_var_version
21 | ENV["BUNDLER_VERSION"]
22 | end
23 |
24 | def cli_arg_version
25 | return unless invoked_as_script? # don't want to hijack other binstubs
26 | return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
27 | bundler_version = nil
28 | update_index = nil
29 | ARGV.each_with_index do |a, i|
30 | if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
31 | bundler_version = a
32 | end
33 | next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
34 | bundler_version = $1
35 | update_index = i
36 | end
37 | bundler_version
38 | end
39 |
40 | def gemfile
41 | gemfile = ENV["BUNDLE_GEMFILE"]
42 | return gemfile if gemfile && !gemfile.empty?
43 |
44 | File.expand_path("../Gemfile", __dir__)
45 | end
46 |
47 | def lockfile
48 | lockfile =
49 | case File.basename(gemfile)
50 | when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
51 | else "#{gemfile}.lock"
52 | end
53 | File.expand_path(lockfile)
54 | end
55 |
56 | def lockfile_version
57 | return unless File.file?(lockfile)
58 | lockfile_contents = File.read(lockfile)
59 | return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
60 | Regexp.last_match(1)
61 | end
62 |
63 | def bundler_requirement
64 | @bundler_requirement ||=
65 | env_var_version || cli_arg_version ||
66 | bundler_requirement_for(lockfile_version)
67 | end
68 |
69 | def bundler_requirement_for(version)
70 | return "#{Gem::Requirement.default}.a" unless version
71 |
72 | bundler_gem_version = Gem::Version.new(version)
73 |
74 | requirement = bundler_gem_version.approximate_recommendation
75 |
76 | return requirement unless Gem.rubygems_version < Gem::Version.new("2.7.0")
77 |
78 | requirement += ".a" if bundler_gem_version.prerelease?
79 |
80 | requirement
81 | end
82 |
83 | def load_bundler!
84 | ENV["BUNDLE_GEMFILE"] ||= gemfile
85 |
86 | activate_bundler
87 | end
88 |
89 | def activate_bundler
90 | gem_error = activation_error_handling do
91 | gem "bundler", bundler_requirement
92 | end
93 | return if gem_error.nil?
94 | require_error = activation_error_handling do
95 | require "bundler/version"
96 | end
97 | return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
98 | warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
99 | exit 42
100 | end
101 |
102 | def activation_error_handling
103 | yield
104 | nil
105 | rescue StandardError, LoadError => e
106 | e
107 | end
108 | end
109 |
110 | m.load_bundler!
111 |
112 | if m.invoked_as_script?
113 | load Gem.bin_path("bundler", "bundle")
114 | end
115 |
--------------------------------------------------------------------------------
/bin/dev:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | if ! foreman version &> /dev/null
4 | then
5 | echo "Installing foreman..."
6 | gem install foreman
7 | fi
8 |
9 | foreman start -f Procfile.dev "$@"
10 |
--------------------------------------------------------------------------------
/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | APP_PATH = File.expand_path("../config/application", __dir__)
3 | require_relative "../config/boot"
4 | require "rails/commands"
5 |
--------------------------------------------------------------------------------
/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require_relative "../config/boot"
3 | require "rake"
4 | Rake.application.run
5 |
--------------------------------------------------------------------------------
/bin/setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require "fileutils"
3 |
4 | # path to your application root.
5 | APP_ROOT = File.expand_path("..", __dir__)
6 |
7 | def system!(*args)
8 | system(*args) || abort("\n== Command #{args} failed ==")
9 | end
10 |
11 | FileUtils.chdir APP_ROOT do
12 | # This script is a way to set up or update your development environment automatically.
13 | # This script is idempotent, so that you can run it at any time and get an expectable outcome.
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 | # puts "\n== Copying sample files =="
21 | # unless File.exist?("config/database.yml")
22 | # FileUtils.cp "config/database.yml.sample", "config/database.yml"
23 | # end
24 |
25 | puts "\n== Preparing database =="
26 | system! "bin/rails db:prepare"
27 |
28 | puts "\n== Removing old logs and tempfiles =="
29 | system! "bin/rails log:clear tmp:clear"
30 |
31 | puts "\n== Restarting application server =="
32 | system! "bin/rails restart"
33 | end
34 |
--------------------------------------------------------------------------------
/config.ru:
--------------------------------------------------------------------------------
1 | # This file is used by Rack-based servers to start the application.
2 |
3 | require_relative "config/environment"
4 |
5 | run Rails.application
6 | Rails.application.load_server
7 |
--------------------------------------------------------------------------------
/config/application.rb:
--------------------------------------------------------------------------------
1 | require_relative "boot"
2 |
3 | require "rails/all"
4 |
5 | # Require the gems listed in Gemfile, including any gems
6 | # you've limited to :test, :development, or :production.
7 | Bundler.require(*Rails.groups)
8 |
9 | module DevWork
10 | class Application < Rails::Application
11 | config.generators do |generate|
12 | generate.assets false
13 | generate.helper false
14 | generate.test_framework :test_unit, fixture: false
15 | end
16 | # Initialize configuration defaults for originally generated Rails version.
17 | config.load_defaults 7.0
18 |
19 | # Configuration for the application, engines, and railties goes here.
20 | #
21 | # These settings can be overridden in specific environments using the files
22 | # in config/environments, which are processed later.
23 | #
24 | # config.time_zone = "Central Time (US & Canada)"
25 | # config.eager_load_paths << Rails.root.join("extras")
26 | end
27 | end
28 |
--------------------------------------------------------------------------------
/config/boot.rb:
--------------------------------------------------------------------------------
1 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
2 |
3 | require "bundler/setup" # Set up gems listed in the Gemfile.
4 | require "bootsnap/setup" # Speed up boot time by caching expensive operations.
5 |
--------------------------------------------------------------------------------
/config/cable.yml:
--------------------------------------------------------------------------------
1 | development:
2 | adapter: async
3 |
4 | test:
5 | adapter: test
6 |
7 | production:
8 | adapter: redis
9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
10 | channel_prefix: DevWork_Production
11 |
--------------------------------------------------------------------------------
/config/credentials.yml.enc:
--------------------------------------------------------------------------------
1 | 5ZLKyGjngKBvEzFITztcuLYikjLSvgNndBbh71pDCKT122MR67/Zu3msmp+t9Ibe7+6ID19rCeJiVjYLx3gs9gy48f8vJioHXSsLeMIaAeCklirwOKZPXlMUHIM7tiCmhXu4XpeP+9vD7LynljWgFaePGcuRGcqIVgIZ+jjrX83PXMOHfDMTFeRI9FVivf0juiH0TjtfqDr89o3GoSQB6sgT022IYcTXGJby9B0csiCzD0t/iAncg1FyKLmn1AyXhrGEjcC+CfFgGIoSIX0tj4/JTZAOQWTAZJvBnwp+1l06sB/OBJOM775B+htS5P5OTDAxjX/16Fr61999iO8ii5yGkWZLX1hASehPBI83/a175VTWGQE63T/PhIqLsXPriWw7vfw1lgH5mJDmqvP+SHTiKgAiAIf2KdIh--9CHFJNM5Cwo48U+a--1X6r/wHpsWWNR5ujTeW2hg==
--------------------------------------------------------------------------------
/config/database.yml:
--------------------------------------------------------------------------------
1 | # PostgreSQL. Versions 9.3 and up are supported.
2 | #
3 | # Install the pg driver:
4 | # gem install pg
5 | # On macOS with Homebrew:
6 | # gem install pg -- --with-pg-config=/usr/local/bin/pg_config
7 | # On macOS with MacPorts:
8 | # gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
9 | # On Windows:
10 | # gem install pg
11 | # Choose the win32 build.
12 | # Install PostgreSQL and put its /bin directory on your path.
13 | #
14 | # Configure Using Gemfile
15 | # gem "pg"
16 | #
17 | default: &default
18 | adapter: postgresql
19 | encoding: unicode
20 | # For details on connection pooling, see Rails configuration guide
21 | # https://guides.rubyonrails.org/configuring.html#database-pooling
22 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
23 |
24 | development:
25 | <<: *default
26 | database: DevWork_Development
27 |
28 | # The specified database role being used to connect to postgres.
29 | # To create additional roles in postgres see `$ createuser --help`.
30 | # When left blank, postgres will use the default role. This is
31 | # the same name as the operating system user running Rails.
32 | #username: rbnb
33 |
34 | # The password associated with the postgres role (username).
35 | #password:
36 |
37 | # Connect on a TCP socket. Omitted by default since the client uses a
38 | # domain socket that doesn't need configuration. Windows does not have
39 | # domain sockets, so uncomment these lines.
40 | #host: localhost
41 |
42 | # The TCP port the server listens on. Defaults to 5432.
43 | # If your server runs on a different port number, change accordingly.
44 | #port: 5432
45 |
46 | # Schema search path. The server defaults to $user,public
47 | #schema_search_path: myapp,sharedapp,public
48 |
49 | # Minimum log levels, in increasing order:
50 | # debug5, debug4, debug3, debug2, debug1,
51 | # log, notice, warning, error, fatal, and panic
52 | # Defaults to warning.
53 | #min_messages: notice
54 |
55 | # Warning: The database defined as "test" will be erased and
56 | # re-generated from your development database when you run "rake".
57 | # Do not set this db to the same as development or production.
58 | test:
59 | <<: *default
60 | database: Devwork_Test
61 |
62 | # As with config/credentials.yml, you never want to store sensitive information,
63 | # like your database password, in your source code. If your source code is
64 | # ever seen by anyone, they now have access to your database.
65 | #
66 | # Instead, provide the password or a full connection URL as an environment
67 | # variable when you boot the app. For example:
68 | #
69 | # DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
70 | #
71 | # If the connection URL is provided in the special DATABASE_URL environment
72 | # variable, Rails will automatically merge its configuration values on top of
73 | # the values provided in this file. Alternatively, you can specify a connection
74 | # URL environment variable explicitly:
75 | #
76 | # production:
77 | # url: <%= ENV["MY_APP_DATABASE_URL"] %>
78 | #
79 | # Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
80 | # for a full overview on how database connection configuration can be specified.
81 | #
82 | production:
83 | <<: *default
84 | database: DevWork_Production
85 | username: DevWork
86 | password: <%= ENV["DEVWORK_DATABASE_PASSWORD"] %>
87 |
--------------------------------------------------------------------------------
/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the Rails application.
2 | require_relative "application"
3 |
4 | # Initialize the Rails application.
5 | Rails.application.initialize!
6 |
--------------------------------------------------------------------------------
/config/environments/development.rb:
--------------------------------------------------------------------------------
1 | require "active_support/core_ext/integer/time"
2 |
3 | Rails.application.configure do
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 any time
7 | # it changes. 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 server timing
18 | config.server_timing = true
19 |
20 | # Enable/disable caching. By default caching is disabled.
21 | # Run rails dev:cache to toggle caching.
22 | if Rails.root.join("tmp/caching-dev.txt").exist?
23 | config.action_controller.perform_caching = true
24 | config.action_controller.enable_fragment_cache_logging = true
25 |
26 | config.cache_store = :memory_store
27 | config.public_file_server.headers = {
28 | "Cache-Control" => "public, max-age=#{2.days.to_i}"
29 | }
30 | else
31 | config.action_controller.perform_caching = false
32 |
33 | config.cache_store = :null_store
34 | end
35 |
36 | # Store uploaded files on the local file system (see config/storage.yml for options).
37 | # config.active_storage.service = :local
38 | config.active_storage.service = :cloudinary
39 |
40 | # Don't care if the mailer can't send.
41 | config.action_mailer.raise_delivery_errors = false
42 |
43 | config.action_mailer.perform_caching = false
44 |
45 | # Print deprecation notices to the Rails logger.
46 | config.active_support.deprecation = :log
47 |
48 | # Raise exceptions for disallowed deprecations.
49 | config.active_support.disallowed_deprecation = :raise
50 |
51 | # Tell Active Support which deprecation messages to disallow.
52 | config.active_support.disallowed_deprecation_warnings = []
53 |
54 | # Raise an error on page load if there are pending migrations.
55 | config.active_record.migration_error = :page_load
56 |
57 | # Highlight code that triggered database queries in logs.
58 | config.active_record.verbose_query_logs = true
59 |
60 | # Suppress logger output for asset requests.
61 | config.assets.quiet = true
62 |
63 | # Raises error for missing translations.
64 | # config.i18n.raise_on_missing_translations = true
65 |
66 | # Annotate rendered view with file names.
67 | # config.action_view.annotate_rendered_view_with_filenames = true
68 |
69 | # Uncomment if you wish to allow Action Cable access from any origin.
70 | # config.action_cable.disable_request_forgery_protection = true
71 | end
72 |
--------------------------------------------------------------------------------
/config/environments/production.rb:
--------------------------------------------------------------------------------
1 | require "active_support/core_ext/integer/time"
2 |
3 | Rails.application.configure do
4 | # Settings specified here will take precedence over those in config/application.rb.
5 |
6 | # Code is not reloaded between requests.
7 | config.cache_classes = true
8 |
9 | # Eager load code on boot. This eager loads most of Rails and
10 | # your application in memory, allowing both threaded web servers
11 | # and those relying on copy on write to perform better.
12 | # Rake tasks automatically ignore this option for performance.
13 | config.eager_load = true
14 |
15 | # Full error reports are disabled and caching is turned on.
16 | config.consider_all_requests_local = false
17 | config.action_controller.perform_caching = true
18 |
19 | # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
20 | # or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
21 | # config.require_master_key = true
22 |
23 | # Disable serving static files from the `/public` folder by default since
24 | # Apache or NGINX already handles this.
25 | config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
26 |
27 | # Compress CSS using a preprocessor.
28 | # config.assets.css_compressor = :sass
29 |
30 | # Do not fallback to assets pipeline if a precompiled asset is missed.
31 | config.assets.compile = false
32 |
33 | # Enable serving of images, stylesheets, and JavaScripts from an asset server.
34 | # config.asset_host = "http://assets.example.com"
35 |
36 | # Specifies the header that your server uses for sending files.
37 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
38 | # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
39 |
40 | # Store uploaded files on the local file system (see config/storage.yml for options).
41 | # config.active_storage.service = :local
42 | config.active_storage.service = :cloudinary
43 |
44 |
45 | # Mount Action Cable outside main process or domain.
46 | # config.action_cable.mount_path = nil
47 | # config.action_cable.url = "wss://example.com/cable"
48 | # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
49 |
50 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
51 | config.force_ssl = true
52 |
53 | # Include generic and useful information about system operation, but avoid logging too much
54 | # information to avoid inadvertent exposure of personally identifiable information (PII).
55 | config.log_level = :info
56 |
57 | # Prepend all log lines with the following tags.
58 | config.log_tags = [ :request_id ]
59 |
60 | # Use a different cache store in production.
61 | # config.cache_store = :mem_cache_store
62 |
63 | # Use a real queuing backend for Active Job (and separate queues per environment).
64 | # config.active_job.queue_adapter = :resque
65 | # config.active_job.queue_name_prefix = "rbnb_production"
66 |
67 | config.action_mailer.perform_caching = false
68 |
69 | # Ignore bad email addresses and do not raise email delivery errors.
70 | # Set this to true and configure the email server for immediate delivery to raise delivery errors.
71 | # config.action_mailer.raise_delivery_errors = false
72 |
73 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
74 | # the I18n.default_locale when a translation cannot be found).
75 | config.i18n.fallbacks = true
76 |
77 | # Don't log any deprecations.
78 | config.active_support.report_deprecations = false
79 |
80 | # Use default logging formatter so that PID and timestamp are not suppressed.
81 | config.log_formatter = ::Logger::Formatter.new
82 |
83 | # Use a different logger for distributed setups.
84 | # require "syslog/logger"
85 | # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")
86 |
87 | if ENV["RAILS_LOG_TO_STDOUT"].present?
88 | logger = ActiveSupport::Logger.new(STDOUT)
89 | logger.formatter = config.log_formatter
90 | config.logger = ActiveSupport::TaggedLogging.new(logger)
91 | end
92 |
93 | # Do not dump schema after migrations.
94 | config.active_record.dump_schema_after_migration = false
95 | end
96 |
--------------------------------------------------------------------------------
/config/environments/test.rb:
--------------------------------------------------------------------------------
1 | require "active_support/core_ext/integer/time"
2 |
3 | # The test environment is used exclusively to run your application's
4 | # test suite. You never need to work with it otherwise. Remember that
5 | # your test database is "scratch space" for the test suite and is wiped
6 | # and recreated between test runs. Don't rely on the data there!
7 |
8 | Rails.application.configure do
9 | # Settings specified here will take precedence over those in config/application.rb.
10 |
11 | # Turn false under Spring and add config.action_view.cache_template_loading = true.
12 | config.cache_classes = true
13 |
14 | # Eager loading loads your whole application. When running a single test locally,
15 | # this probably isn't necessary. It's a good idea to do in a continuous integration
16 | # system, or in some way before deploying your code.
17 | config.eager_load = ENV["CI"].present?
18 |
19 | # Configure public file server for tests with Cache-Control for performance.
20 | config.public_file_server.enabled = true
21 | config.public_file_server.headers = {
22 | "Cache-Control" => "public, max-age=#{1.hour.to_i}"
23 | }
24 |
25 | # Show full error reports and disable caching.
26 | config.consider_all_requests_local = true
27 | config.action_controller.perform_caching = false
28 | config.cache_store = :null_store
29 |
30 | # Raise exceptions instead of rendering exception templates.
31 | config.action_dispatch.show_exceptions = false
32 |
33 | # Disable request forgery protection in test environment.
34 | config.action_controller.allow_forgery_protection = false
35 |
36 | # Store uploaded files on the local file system in a temporary directory.
37 | config.active_storage.service = :test
38 |
39 | config.action_mailer.perform_caching = false
40 |
41 | # Tell Action Mailer not to deliver emails to the real world.
42 | # The :test delivery method accumulates sent emails in the
43 | # ActionMailer::Base.deliveries array.
44 | config.action_mailer.delivery_method = :test
45 |
46 | # Print deprecation notices to the stderr.
47 | config.active_support.deprecation = :stderr
48 |
49 | # Raise exceptions for disallowed deprecations.
50 | config.active_support.disallowed_deprecation = :raise
51 |
52 | # Tell Active Support which deprecation messages to disallow.
53 | config.active_support.disallowed_deprecation_warnings = []
54 |
55 | # Raises error for missing translations.
56 | # config.i18n.raise_on_missing_translations = true
57 |
58 | # Annotate rendered view with file names.
59 | # config.action_view.annotate_rendered_view_with_filenames = true
60 | end
61 |
--------------------------------------------------------------------------------
/config/initializers/assets.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Version of your assets, change this if you want to expire all your assets.
4 | Rails.application.config.assets.version = "1.0"
5 |
6 | # Add additional assets to the asset load path.
7 | # Rails.application.config.assets.paths << Emoji.images_path
8 |
9 | Rails.application.config.assets.paths << Rails.root.join("node_modules")
10 | # Precompile additional assets.
11 | # application.js, application.css, and all non-JS/CSS in the app/assets
12 | # folder are already added.
13 | # Rails.application.config.assets.precompile += %w( admin.js admin.css )
14 |
--------------------------------------------------------------------------------
/config/initializers/content_security_policy.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Define an application-wide content security policy.
4 | # See the Securing Rails Applications Guide for more information:
5 | # https://guides.rubyonrails.org/security.html#content-security-policy-header
6 |
7 | # Rails.application.configure do
8 | # config.content_security_policy do |policy|
9 | # policy.default_src :self, :https
10 | # policy.font_src :self, :https, :data
11 | # policy.img_src :self, :https, :data
12 | # policy.object_src :none
13 | # policy.script_src :self, :https
14 | # policy.style_src :self, :https
15 | # # Specify URI for violation reports
16 | # # policy.report_uri "/csp-violation-report-endpoint"
17 | # end
18 | #
19 | # # Generate session nonces for permitted importmap and inline scripts
20 | # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
21 | # config.content_security_policy_nonce_directives = %w(script-src)
22 | #
23 | # # Report violations without enforcing the policy.
24 | # # config.content_security_policy_report_only = true
25 | # end
26 |
--------------------------------------------------------------------------------
/config/initializers/filter_parameter_logging.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Configure parameters to be filtered from the log file. Use this to limit dissemination of
4 | # sensitive information. See the ActiveSupport::ParameterFilter documentation for supported
5 | # notations and behaviors.
6 | Rails.application.config.filter_parameters += [
7 | :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
8 | ]
9 |
--------------------------------------------------------------------------------
/config/initializers/geocoder.rb:
--------------------------------------------------------------------------------
1 | Geocoder.configure(
2 | # Geocoding options
3 | # timeout: 3, # geocoding service timeout (secs)
4 | # lookup: :nominatim, # name of geocoding service (symbol)
5 | # ip_lookup: :ipinfo_io, # name of IP address geocoding service (symbol)
6 | # language: :en, # ISO-639 language code
7 | # use_https: false, # use HTTPS for lookup requests? (if supported)
8 | # http_proxy: nil, # HTTP proxy server (user:pass@host:port)
9 | # https_proxy: nil, # HTTPS proxy server (user:pass@host:port)
10 | # api_key: nil, # API key for geocoding service
11 | # cache: nil, # cache object (must respond to #[], #[]=, and #del)
12 |
13 | # Exceptions that should not be rescued by default
14 | # (if you want to implement custom error handling);
15 | # supports SocketError and Timeout::Error
16 | # always_raise: [],
17 |
18 | # Calculation options
19 | units: :km, # :km for kilometers or :mi for miles
20 | # distances: :linear # :spherical or :linear
21 |
22 | # Cache configuration
23 | # cache_options: {
24 | # expiration: 2.days,
25 | # prefix: 'geocoder:'
26 | # }
27 | )
28 |
--------------------------------------------------------------------------------
/config/initializers/inflections.rb:
--------------------------------------------------------------------------------
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
17 |
--------------------------------------------------------------------------------
/config/initializers/permissions_policy.rb:
--------------------------------------------------------------------------------
1 | # Define an application-wide HTTP permissions policy. For further
2 | # information see https://developers.google.com/web/updates/2018/06/feature-policy
3 | #
4 | # Rails.application.config.permissions_policy do |f|
5 | # f.camera :none
6 | # f.gyroscope :none
7 | # f.microphone :none
8 | # f.usb :none
9 | # f.fullscreen :self
10 | # f.payment :self, "https://secure.example.com"
11 | # end
12 |
--------------------------------------------------------------------------------
/config/initializers/simple_form.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | #
3 | # Uncomment this and change the path if necessary to include your own
4 | # components.
5 | # See https://github.com/heartcombo/simple_form#custom-components to know
6 | # more about custom components.
7 | # Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f }
8 | #
9 | # Use this setup block to configure all options available in SimpleForm.
10 | SimpleForm.setup do |config|
11 | # Wrappers are used by the form builder to generate a
12 | # complete input. You can remove any component from the
13 | # wrapper, change the order or even add your own to the
14 | # stack. The options given below are used to wrap the
15 | # whole input.
16 | config.wrappers :default, class: :input,
17 | hint_class: :field_with_hint, error_class: :field_with_errors, valid_class: :field_without_errors do |b|
18 | ## Extensions enabled by default
19 | # Any of these extensions can be disabled for a
20 | # given input by passing: `f.input EXTENSION_NAME => false`.
21 | # You can make any of these extensions optional by
22 | # renaming `b.use` to `b.optional`.
23 |
24 | # Determines whether to use HTML5 (:email, :url, ...)
25 | # and required attributes
26 | b.use :html5
27 |
28 | # Calculates placeholders automatically from I18n
29 | # You can also pass a string as f.input placeholder: "Placeholder"
30 | b.use :placeholder
31 |
32 | ## Optional extensions
33 | # They are disabled unless you pass `f.input EXTENSION_NAME => true`
34 | # to the input. If so, they will retrieve the values from the model
35 | # if any exists. If you want to enable any of those
36 | # extensions by default, you can change `b.optional` to `b.use`.
37 |
38 | # Calculates maxlength from length validations for string inputs
39 | # and/or database column lengths
40 | b.optional :maxlength
41 |
42 | # Calculate minlength from length validations for string inputs
43 | b.optional :minlength
44 |
45 | # Calculates pattern from format validations for string inputs
46 | b.optional :pattern
47 |
48 | # Calculates min and max from length validations for numeric inputs
49 | b.optional :min_max
50 |
51 | # Calculates readonly automatically from readonly attributes
52 | b.optional :readonly
53 |
54 | ## Inputs
55 | # b.use :input, class: 'input', error_class: 'is-invalid', valid_class: 'is-valid'
56 | b.use :label_input
57 | b.use :hint, wrap_with: { tag: :span, class: :hint }
58 | b.use :error, wrap_with: { tag: :span, class: :error }
59 |
60 | ## full_messages_for
61 | # If you want to display the full error message for the attribute, you can
62 | # use the component :full_error, like:
63 | #
64 | # b.use :full_error, wrap_with: { tag: :span, class: :error }
65 | end
66 |
67 | # The default wrapper to be used by the FormBuilder.
68 | config.default_wrapper = :default
69 |
70 | # Define the way to render check boxes / radio buttons with labels.
71 | # Defaults to :nested for bootstrap config.
72 | # inline: input + label
73 | # nested: label > input
74 | config.boolean_style = :nested
75 |
76 | # Default class for buttons
77 | config.button_class = 'btn'
78 |
79 | # Method used to tidy up errors. Specify any Rails Array method.
80 | # :first lists the first message for each field.
81 | # Use :to_sentence to list all errors for each field.
82 | # config.error_method = :first
83 |
84 | # Default tag used for error notification helper.
85 | config.error_notification_tag = :div
86 |
87 | # CSS class to add for error notification helper.
88 | config.error_notification_class = 'error_notification'
89 |
90 | # Series of attempts to detect a default label method for collection.
91 | # config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
92 |
93 | # Series of attempts to detect a default value method for collection.
94 | # config.collection_value_methods = [ :id, :to_s ]
95 |
96 | # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
97 | # config.collection_wrapper_tag = nil
98 |
99 | # You can define the class to use on all collection wrappers. Defaulting to none.
100 | # config.collection_wrapper_class = nil
101 |
102 | # You can wrap each item in a collection of radio/check boxes with a tag,
103 | # defaulting to :span.
104 | # config.item_wrapper_tag = :span
105 |
106 | # You can define a class to use in all item wrappers. Defaulting to none.
107 | # config.item_wrapper_class = nil
108 |
109 | # How the label text should be generated altogether with the required text.
110 | # config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" }
111 |
112 | # You can define the class to use on all labels. Default is nil.
113 | # config.label_class = nil
114 |
115 | # You can define the default class to be used on forms. Can be overridden
116 | # with `html: { :class }`. Defaulting to none.
117 | # config.default_form_class = nil
118 |
119 | # You can define which elements should obtain additional classes
120 | # config.generate_additional_classes_for = [:wrapper, :label, :input]
121 |
122 | # Whether attributes are required by default (or not). Default is true.
123 | # config.required_by_default = true
124 |
125 | # Tell browsers whether to use the native HTML5 validations (novalidate form option).
126 | # These validations are enabled in SimpleForm's internal config but disabled by default
127 | # in this configuration, which is recommended due to some quirks from different browsers.
128 | # To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
129 | # change this configuration to true.
130 | config.browser_validations = false
131 |
132 | # Custom mappings for input types. This should be a hash containing a regexp
133 | # to match as key, and the input type that will be used when the field name
134 | # matches the regexp as value.
135 | # config.input_mappings = { /count/ => :integer }
136 |
137 | # Custom wrappers for input types. This should be a hash containing an input
138 | # type as key and the wrapper that will be used for all inputs with specified type.
139 | # config.wrapper_mappings = { string: :prepend }
140 |
141 | # Namespaces where SimpleForm should look for custom input classes that
142 | # override default inputs.
143 | # config.custom_inputs_namespaces << "CustomInputs"
144 |
145 | # Default priority for time_zone inputs.
146 | # config.time_zone_priority = nil
147 |
148 | # Default priority for country inputs.
149 | # config.country_priority = nil
150 |
151 | # When false, do not use translations for labels.
152 | # config.translate_labels = true
153 |
154 | # Automatically discover new inputs in Rails' autoload path.
155 | # config.inputs_discovery = true
156 |
157 | # Cache SimpleForm inputs discovery
158 | # config.cache_discovery = !Rails.env.development?
159 |
160 | # Default class for inputs
161 | # config.input_class = nil
162 |
163 | # Define the default class of the input wrapper of the boolean input.
164 | config.boolean_label_class = 'checkbox'
165 |
166 | # Defines if the default input wrapper class should be included in radio
167 | # collection wrappers.
168 | # config.include_default_input_wrapper_class = true
169 |
170 | # Defines which i18n scope will be used in Simple Form.
171 | # config.i18n_scope = 'simple_form'
172 |
173 | # Defines validation classes to the input_field. By default it's nil.
174 | # config.input_field_valid_class = 'is-valid'
175 | # config.input_field_error_class = 'is-invalid'
176 | end
177 |
--------------------------------------------------------------------------------
/config/initializers/simple_form_bootstrap.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | # These defaults are defined and maintained by the community at
4 | # https://github.com/heartcombo/simple_form-bootstrap
5 | # Please submit feedback, changes and tests only there.
6 |
7 | # Uncomment this and change the path if necessary to include your own
8 | # components.
9 | # See https://github.com/heartcombo/simple_form#custom-components
10 | # to know more about custom components.
11 | # Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f }
12 |
13 | # Use this setup block to configure all options available in SimpleForm.
14 | SimpleForm.setup do |config|
15 | # Default class for buttons
16 | config.button_class = 'btn'
17 |
18 | # Define the default class of the input wrapper of the boolean input.
19 | config.boolean_label_class = 'form-check-label'
20 |
21 | # How the label text should be generated altogether with the required text.
22 | config.label_text = lambda { |label, required, explicit_label| "#{label} #{required}" }
23 |
24 | # Define the way to render check boxes / radio buttons with labels.
25 | config.boolean_style = :inline
26 |
27 | # You can wrap each item in a collection of radio/check boxes with a tag
28 | config.item_wrapper_tag = :div
29 |
30 | # Defines if the default input wrapper class should be included in radio
31 | # collection wrappers.
32 | config.include_default_input_wrapper_class = false
33 |
34 | # CSS class to add for error notification helper.
35 | config.error_notification_class = 'alert alert-danger'
36 |
37 | # Method used to tidy up errors. Specify any Rails Array method.
38 | # :first lists the first message for each field.
39 | # :to_sentence to list all errors for each field.
40 | config.error_method = :to_sentence
41 |
42 | # add validation classes to `input_field`
43 | config.input_field_error_class = 'is-invalid'
44 | config.input_field_valid_class = 'is-valid'
45 |
46 |
47 | # vertical forms
48 | #
49 | # vertical default_wrapper
50 | config.wrappers :vertical_form, class: 'mb-3' do |b|
51 | b.use :html5
52 | b.use :placeholder
53 | b.optional :maxlength
54 | b.optional :minlength
55 | b.optional :pattern
56 | b.optional :min_max
57 | b.optional :readonly
58 | b.use :label, class: 'form-label'
59 | b.use :input, class: 'form-control', error_class: 'is-invalid', valid_class: 'is-valid'
60 | b.use :full_error, wrap_with: { class: 'invalid-feedback' }
61 | b.use :hint, wrap_with: { class: 'form-text' }
62 | end
63 |
64 | # vertical input for boolean
65 | config.wrappers :vertical_boolean, tag: 'fieldset', class: 'mb-3' do |b|
66 | b.use :html5
67 | b.optional :readonly
68 | b.wrapper :form_check_wrapper, class: 'form-check' do |bb|
69 | bb.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid'
70 | bb.use :label, class: 'form-check-label'
71 | bb.use :full_error, wrap_with: { class: 'invalid-feedback' }
72 | bb.use :hint, wrap_with: { class: 'form-text' }
73 | end
74 | end
75 |
76 | # vertical input for radio buttons and check boxes
77 | config.wrappers :vertical_collection, item_wrapper_class: 'form-check', item_label_class: 'form-check-label', tag: 'fieldset', class: 'mb-3' do |b|
78 | b.use :html5
79 | b.optional :readonly
80 | b.wrapper :legend_tag, tag: 'legend', class: 'col-form-label pt-0' do |ba|
81 | ba.use :label_text
82 | end
83 | b.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid'
84 | b.use :full_error, wrap_with: { class: 'invalid-feedback d-block' }
85 | b.use :hint, wrap_with: { class: 'form-text' }
86 | end
87 |
88 | # vertical input for inline radio buttons and check boxes
89 | config.wrappers :vertical_collection_inline, item_wrapper_class: 'form-check form-check-inline', item_label_class: 'form-check-label', tag: 'fieldset', class: 'mb-3' do |b|
90 | b.use :html5
91 | b.optional :readonly
92 | b.wrapper :legend_tag, tag: 'legend', class: 'col-form-label pt-0' do |ba|
93 | ba.use :label_text
94 | end
95 | b.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid'
96 | b.use :full_error, wrap_with: { class: 'invalid-feedback d-block' }
97 | b.use :hint, wrap_with: { class: 'form-text' }
98 | end
99 |
100 | # vertical file input
101 | config.wrappers :vertical_file, class: 'mb-3' do |b|
102 | b.use :html5
103 | b.use :placeholder
104 | b.optional :maxlength
105 | b.optional :minlength
106 | b.optional :readonly
107 | b.use :label, class: 'form-label'
108 | b.use :input, class: 'form-control', error_class: 'is-invalid', valid_class: 'is-valid'
109 | b.use :full_error, wrap_with: { class: 'invalid-feedback' }
110 | b.use :hint, wrap_with: { class: 'form-text' }
111 | end
112 |
113 | # vertical select input
114 | config.wrappers :vertical_select, class: 'mb-3' do |b|
115 | b.use :html5
116 | b.optional :readonly
117 | b.use :label, class: 'form-label'
118 | b.use :input, class: 'form-select', error_class: 'is-invalid', valid_class: 'is-valid'
119 | b.use :full_error, wrap_with: { class: 'invalid-feedback' }
120 | b.use :hint, wrap_with: { class: 'form-text' }
121 | end
122 |
123 | # vertical multi select
124 | config.wrappers :vertical_multi_select, class: 'mb-3' do |b|
125 | b.use :html5
126 | b.optional :readonly
127 | b.use :label, class: 'form-label'
128 | b.wrapper class: 'd-flex flex-row justify-content-between align-items-center' do |ba|
129 | ba.use :input, class: 'form-select mx-1', error_class: 'is-invalid', valid_class: 'is-valid'
130 | end
131 | b.use :full_error, wrap_with: { class: 'invalid-feedback d-block' }
132 | b.use :hint, wrap_with: { class: 'form-text' }
133 | end
134 |
135 | # vertical range input
136 | config.wrappers :vertical_range, class: 'mb-3' do |b|
137 | b.use :html5
138 | b.use :placeholder
139 | b.optional :readonly
140 | b.optional :step
141 | b.use :label, class: 'form-label'
142 | b.use :input, class: 'form-range', error_class: 'is-invalid', valid_class: 'is-valid'
143 | b.use :full_error, wrap_with: { class: 'invalid-feedback' }
144 | b.use :hint, wrap_with: { class: 'form-text' }
145 | end
146 |
147 |
148 | # horizontal forms
149 | #
150 | # horizontal default_wrapper
151 | config.wrappers :horizontal_form, class: 'row mb-3' do |b|
152 | b.use :html5
153 | b.use :placeholder
154 | b.optional :maxlength
155 | b.optional :minlength
156 | b.optional :pattern
157 | b.optional :min_max
158 | b.optional :readonly
159 | b.use :label, class: 'col-sm-3 col-form-label'
160 | b.wrapper :grid_wrapper, class: 'col-sm-9' do |ba|
161 | ba.use :input, class: 'form-control', error_class: 'is-invalid', valid_class: 'is-valid'
162 | ba.use :full_error, wrap_with: { class: 'invalid-feedback' }
163 | ba.use :hint, wrap_with: { class: 'form-text' }
164 | end
165 | end
166 |
167 | # horizontal input for boolean
168 | config.wrappers :horizontal_boolean, class: 'row mb-3' do |b|
169 | b.use :html5
170 | b.optional :readonly
171 | b.wrapper :grid_wrapper, class: 'col-sm-9 offset-sm-3' do |wr|
172 | wr.wrapper :form_check_wrapper, class: 'form-check' do |bb|
173 | bb.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid'
174 | bb.use :label, class: 'form-check-label'
175 | bb.use :full_error, wrap_with: { class: 'invalid-feedback' }
176 | bb.use :hint, wrap_with: { class: 'form-text' }
177 | end
178 | end
179 | end
180 |
181 | # horizontal input for radio buttons and check boxes
182 | config.wrappers :horizontal_collection, item_wrapper_class: 'form-check', item_label_class: 'form-check-label', class: 'row mb-3' do |b|
183 | b.use :html5
184 | b.optional :readonly
185 | b.use :label, class: 'col-sm-3 col-form-label pt-0'
186 | b.wrapper :grid_wrapper, class: 'col-sm-9' do |ba|
187 | ba.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid'
188 | ba.use :full_error, wrap_with: { class: 'invalid-feedback d-block' }
189 | ba.use :hint, wrap_with: { class: 'form-text' }
190 | end
191 | end
192 |
193 | # horizontal input for inline radio buttons and check boxes
194 | config.wrappers :horizontal_collection_inline, item_wrapper_class: 'form-check form-check-inline', item_label_class: 'form-check-label', class: 'row mb-3' do |b|
195 | b.use :html5
196 | b.optional :readonly
197 | b.use :label, class: 'col-sm-3 col-form-label pt-0'
198 | b.wrapper :grid_wrapper, class: 'col-sm-9' do |ba|
199 | ba.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid'
200 | ba.use :full_error, wrap_with: { class: 'invalid-feedback d-block' }
201 | ba.use :hint, wrap_with: { class: 'form-text' }
202 | end
203 | end
204 |
205 | # horizontal file input
206 | config.wrappers :horizontal_file, class: 'row mb-3' do |b|
207 | b.use :html5
208 | b.use :placeholder
209 | b.optional :maxlength
210 | b.optional :minlength
211 | b.optional :readonly
212 | b.use :label, class: 'col-sm-3 col-form-label'
213 | b.wrapper :grid_wrapper, class: 'col-sm-9' do |ba|
214 | ba.use :input, class: 'form-control', error_class: 'is-invalid', valid_class: 'is-valid'
215 | ba.use :full_error, wrap_with: { class: 'invalid-feedback' }
216 | ba.use :hint, wrap_with: { class: 'form-text' }
217 | end
218 | end
219 |
220 | # horizontal select input
221 | config.wrappers :horizontal_select, class: 'row mb-3' do |b|
222 | b.use :html5
223 | b.optional :readonly
224 | b.use :label, class: 'col-sm-3 col-form-label'
225 | b.wrapper :grid_wrapper, class: 'col-sm-9' do |ba|
226 | ba.use :input, class: 'form-select', error_class: 'is-invalid', valid_class: 'is-valid'
227 | ba.use :full_error, wrap_with: { class: 'invalid-feedback' }
228 | ba.use :hint, wrap_with: { class: 'form-text' }
229 | end
230 | end
231 |
232 | # horizontal multi select
233 | config.wrappers :horizontal_multi_select, class: 'row mb-3' do |b|
234 | b.use :html5
235 | b.optional :readonly
236 | b.use :label, class: 'col-sm-3 col-form-label'
237 | b.wrapper :grid_wrapper, class: 'col-sm-9' do |ba|
238 | ba.wrapper class: 'd-flex flex-row justify-content-between align-items-center' do |bb|
239 | bb.use :input, class: 'form-select mx-1', error_class: 'is-invalid', valid_class: 'is-valid'
240 | end
241 | ba.use :full_error, wrap_with: { class: 'invalid-feedback d-block' }
242 | ba.use :hint, wrap_with: { class: 'form-text' }
243 | end
244 | end
245 |
246 | # horizontal range input
247 | config.wrappers :horizontal_range, class: 'row mb-3' do |b|
248 | b.use :html5
249 | b.use :placeholder
250 | b.optional :readonly
251 | b.optional :step
252 | b.use :label, class: 'col-sm-3 col-form-label pt-0'
253 | b.wrapper :grid_wrapper, class: 'col-sm-9' do |ba|
254 | ba.use :input, class: 'form-range', error_class: 'is-invalid', valid_class: 'is-valid'
255 | ba.use :full_error, wrap_with: { class: 'invalid-feedback' }
256 | ba.use :hint, wrap_with: { class: 'form-text' }
257 | end
258 | end
259 |
260 |
261 | # inline forms
262 | #
263 | # inline default_wrapper
264 | config.wrappers :inline_form, class: 'col-12' do |b|
265 | b.use :html5
266 | b.use :placeholder
267 | b.optional :maxlength
268 | b.optional :minlength
269 | b.optional :pattern
270 | b.optional :min_max
271 | b.optional :readonly
272 | b.use :label, class: 'visually-hidden'
273 |
274 | b.use :input, class: 'form-control', error_class: 'is-invalid', valid_class: 'is-valid'
275 | b.use :error, wrap_with: { class: 'invalid-feedback' }
276 | b.optional :hint, wrap_with: { class: 'form-text' }
277 | end
278 |
279 | # inline input for boolean
280 | config.wrappers :inline_boolean, class: 'col-12' do |b|
281 | b.use :html5
282 | b.optional :readonly
283 | b.wrapper :form_check_wrapper, class: 'form-check' do |bb|
284 | bb.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid'
285 | bb.use :label, class: 'form-check-label'
286 | bb.use :error, wrap_with: { class: 'invalid-feedback' }
287 | bb.optional :hint, wrap_with: { class: 'form-text' }
288 | end
289 | end
290 |
291 |
292 | # bootstrap custom forms
293 | #
294 | # custom input switch for boolean
295 | config.wrappers :custom_boolean_switch, class: 'mb-3' do |b|
296 | b.use :html5
297 | b.optional :readonly
298 | b.wrapper :form_check_wrapper, tag: 'div', class: 'form-check form-switch' do |bb|
299 | bb.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid'
300 | bb.use :label, class: 'form-check-label'
301 | bb.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback' }
302 | bb.use :hint, wrap_with: { class: 'form-text' }
303 | end
304 | end
305 |
306 |
307 | # Input Group - custom component
308 | # see example app and config at https://github.com/heartcombo/simple_form-bootstrap
309 | config.wrappers :input_group, class: 'mb-3' do |b|
310 | b.use :html5
311 | b.use :placeholder
312 | b.optional :maxlength
313 | b.optional :minlength
314 | b.optional :pattern
315 | b.optional :min_max
316 | b.optional :readonly
317 | b.use :label, class: 'form-label'
318 | b.wrapper :input_group_tag, class: 'input-group' do |ba|
319 | ba.optional :prepend
320 | ba.use :input, class: 'form-control', error_class: 'is-invalid', valid_class: 'is-valid'
321 | ba.optional :append
322 | ba.use :full_error, wrap_with: { class: 'invalid-feedback' }
323 | end
324 | b.use :hint, wrap_with: { class: 'form-text' }
325 | end
326 |
327 |
328 | # Floating Labels form
329 | #
330 | # floating labels default_wrapper
331 | config.wrappers :floating_labels_form, class: 'form-floating mb-3' do |b|
332 | b.use :html5
333 | b.use :placeholder
334 | b.optional :maxlength
335 | b.optional :minlength
336 | b.optional :pattern
337 | b.optional :min_max
338 | b.optional :readonly
339 | b.use :input, class: 'form-control', error_class: 'is-invalid', valid_class: 'is-valid'
340 | b.use :label
341 | b.use :full_error, wrap_with: { class: 'invalid-feedback' }
342 | b.use :hint, wrap_with: { class: 'form-text' }
343 | end
344 |
345 | # custom multi select
346 | config.wrappers :floating_labels_select, class: 'form-floating mb-3' do |b|
347 | b.use :html5
348 | b.optional :readonly
349 | b.use :input, class: 'form-select', error_class: 'is-invalid', valid_class: 'is-valid'
350 | b.use :label
351 | b.use :full_error, wrap_with: { class: 'invalid-feedback' }
352 | b.use :hint, wrap_with: { class: 'form-text' }
353 | end
354 |
355 |
356 | # The default wrapper to be used by the FormBuilder.
357 | config.default_wrapper = :vertical_form
358 |
359 | # Custom wrappers for input types. This should be a hash containing an input
360 | # type as key and the wrapper that will be used for all inputs with specified type.
361 | config.wrapper_mappings = {
362 | boolean: :vertical_boolean,
363 | check_boxes: :vertical_collection,
364 | date: :vertical_multi_select,
365 | datetime: :vertical_multi_select,
366 | file: :vertical_file,
367 | radio_buttons: :vertical_collection,
368 | range: :vertical_range,
369 | time: :vertical_multi_select,
370 | select: :vertical_select
371 | }
372 | end
373 |
--------------------------------------------------------------------------------
/config/locales/devise.en.yml:
--------------------------------------------------------------------------------
1 | # Additional translations at https://github.com/heartcombo/devise/wiki/I18n
2 |
3 | en:
4 | devise:
5 | confirmations:
6 | confirmed: "Your email address has been successfully confirmed."
7 | send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
8 | send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
9 | failure:
10 | already_authenticated: "You are already signed in."
11 | inactive: "Your account is not activated yet."
12 | invalid: "Invalid %{authentication_keys} or password."
13 | locked: "Your account is locked."
14 | last_attempt: "You have one more attempt before your account is locked."
15 | not_found_in_database: "Invalid %{authentication_keys} or password."
16 | timeout: "Your session expired. Please sign in again to continue."
17 | unauthenticated: "You need to sign in or sign up before continuing."
18 | unconfirmed: "You have to confirm your email address before continuing."
19 | mailer:
20 | confirmation_instructions:
21 | subject: "Confirmation instructions"
22 | reset_password_instructions:
23 | subject: "Reset password instructions"
24 | unlock_instructions:
25 | subject: "Unlock instructions"
26 | email_changed:
27 | subject: "Email Changed"
28 | password_change:
29 | subject: "Password Changed"
30 | omniauth_callbacks:
31 | failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
32 | success: "Successfully authenticated from %{kind} account."
33 | passwords:
34 | no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
35 | send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
36 | send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
37 | updated: "Your password has been changed successfully. You are now signed in."
38 | updated_not_active: "Your password has been changed successfully."
39 | registrations:
40 | destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
41 | signed_up: "Welcome! You have signed up successfully."
42 | signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
43 | signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
44 | signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
45 | update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirmation link to confirm your new email address."
46 | updated: "Your account has been updated successfully."
47 | updated_but_not_signed_in: "Your account has been updated successfully, but since your password was changed, you need to sign in again."
48 | sessions:
49 | signed_in: "Signed in successfully."
50 | signed_out: "Signed out successfully."
51 | already_signed_out: "Signed out successfully."
52 | unlocks:
53 | send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
54 | send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
55 | unlocked: "Your account has been unlocked successfully. Please sign in to continue."
56 | errors:
57 | messages:
58 | already_confirmed: "was already confirmed, please try signing in"
59 | confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
60 | expired: "has expired, please request a new one"
61 | not_found: "not found"
62 | not_locked: "was not locked"
63 | not_saved:
64 | one: "1 error prohibited this %{resource} from being saved:"
65 | other: "%{count} errors prohibited this %{resource} from being saved:"
66 |
--------------------------------------------------------------------------------
/config/locales/en.yml:
--------------------------------------------------------------------------------
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 https://guides.rubyonrails.org/i18n.html.
31 |
32 | en:
33 | hello: "Hello world"
34 |
--------------------------------------------------------------------------------
/config/locales/simple_form.en.yml:
--------------------------------------------------------------------------------
1 | en:
2 | simple_form:
3 | "yes": 'Yes'
4 | "no": 'No'
5 | required:
6 | text: 'required'
7 | mark: '*'
8 | # You can uncomment the line below if you need to overwrite the whole required html.
9 | # When using html, text and mark won't be used.
10 | # html: '
* '
11 | error_notification:
12 | default_message: "Please review the problems below:"
13 | # Examples
14 | # labels:
15 | # defaults:
16 | # password: 'Password'
17 | # user:
18 | # new:
19 | # email: 'E-mail to sign in.'
20 | # edit:
21 | # email: 'E-mail.'
22 | # hints:
23 | # defaults:
24 | # username: 'User name to sign in.'
25 | # password: 'No special characters, please.'
26 | # include_blanks:
27 | # defaults:
28 | # age: 'Rather not say'
29 | # prompts:
30 | # defaults:
31 | # age: 'Select your age'
32 |
--------------------------------------------------------------------------------
/config/puma.rb:
--------------------------------------------------------------------------------
1 | # Puma can serve each request in a thread from an internal thread pool.
2 | # The `threads` method setting takes two numbers: a minimum and maximum.
3 | # Any libraries that use thread pools should be configured to match
4 | # the maximum value specified for Puma. Default is set to 5 threads for minimum
5 | # and maximum; this matches the default thread size of Active Record.
6 | #
7 | max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
8 | min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
9 | threads min_threads_count, max_threads_count
10 |
11 | # Specifies the `worker_timeout` threshold that Puma will use to wait before
12 | # terminating a worker in development environments.
13 | #
14 | worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
15 |
16 | # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
17 | #
18 | port ENV.fetch("PORT") { 3000 }
19 |
20 | # Specifies the `environment` that Puma will run in.
21 | #
22 | environment ENV.fetch("RAILS_ENV") { "development" }
23 |
24 | # Specifies the `pidfile` that Puma will use.
25 | pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
26 |
27 | # Specifies the number of `workers` to boot in clustered mode.
28 | # Workers are forked web server processes. If using threads and workers together
29 | # the concurrency of the application would be max `threads` * `workers`.
30 | # Workers do not work on JRuby or Windows (both of which do not support
31 | # processes).
32 | #
33 | # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
34 |
35 | # Use the `preload_app!` method when specifying a `workers` number.
36 | # This directive tells Puma to first boot the application and load code
37 | # before forking the application. This takes advantage of Copy On Write
38 | # process behavior so workers use less memory.
39 | #
40 | # preload_app!
41 |
42 | # Allow puma to be restarted by `bin/rails restart` command.
43 | plugin :tmp_restart
44 |
--------------------------------------------------------------------------------
/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 | devise_for :users, :controllers => {:registrations => "registrations", omniauth_callbacks: "callbacks"}
3 | root to: "pages#home"
4 | # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
5 |
6 | # Defines the root path route ("/")
7 | # root "articles#index"
8 | resources :challenges, only: %i[show index new create destroy edit update] do
9 | resources :offers, only: %i[show index create update]
10 | resources :comments, only: %i[index create]
11 | end
12 | resources :users, only: [:index, :show, :edit, :update], path: "index" do
13 | end
14 | resources :offers, only: %i[destroy]
15 | # resources :comments, only: %i[edit update destroy]
16 | get '/my_challenges', action: :index, controller: 'challenges'
17 | get '/my_offers', action: :index, controller: 'offers'
18 | end
19 |
--------------------------------------------------------------------------------
/config/storage.yml:
--------------------------------------------------------------------------------
1 | test:
2 | service: Disk
3 | root: <%= Rails.root.join("tmp/storage") %>
4 |
5 | local:
6 | service: Disk
7 | root: <%= Rails.root.join("storage") %>
8 |
9 | # Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
10 | # amazon:
11 | # service: S3
12 | # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
13 | # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
14 | # region: us-east-1
15 | # bucket: your_own_bucket-<%= Rails.env %>
16 |
17 | # Remember not to checkin your GCS keyfile to a repository
18 | # google:
19 | # service: GCS
20 | # project: your_project
21 | # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
22 | # bucket: your_own_bucket-<%= Rails.env %>
23 |
24 | # Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
25 | # microsoft:
26 | # service: AzureStorage
27 | # storage_account_name: your_account_name
28 | # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
29 | # container: your_container_name-<%= Rails.env %>
30 |
31 | # mirror:
32 | # service: Mirror
33 | # primary: local
34 | # mirrors: [ amazon, google, microsoft ]
35 | cloudinary:
36 | service: Cloudinary
37 | folder: <%= Rails.env %>
38 |
--------------------------------------------------------------------------------
/db/migrate/20220829123454_create_users.rb:
--------------------------------------------------------------------------------
1 | class CreateUsers < ActiveRecord::Migration[7.0]
2 | def change
3 | create_table :users do |t|
4 |
5 | t.timestamps
6 | end
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20220829123545_create_filters.rb:
--------------------------------------------------------------------------------
1 | class CreateFilters < ActiveRecord::Migration[7.0]
2 | def change
3 | create_table :filters do |t|
4 |
5 | t.timestamps
6 | end
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20220829124023_create_challenges.rb:
--------------------------------------------------------------------------------
1 | class CreateChallenges < ActiveRecord::Migration[7.0]
2 | def change
3 | create_table :challenges do |t|
4 | t.references :filter, null: false, foreign_key: true
5 | t.references :user, null: false, foreign_key: true
6 |
7 | t.timestamps
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/db/migrate/20220829135339_add_details_to_users.rb:
--------------------------------------------------------------------------------
1 | class AddDetailsToUsers < ActiveRecord::Migration[7.0]
2 | def change
3 | add_column :users, :nickname, :string
4 | add_column :users, :name, :string
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20220829135415_add_details_to_filters.rb:
--------------------------------------------------------------------------------
1 | class AddDetailsToFilters < ActiveRecord::Migration[7.0]
2 | def change
3 | add_column :filters, :name, :string
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20220829135525_add_details_to_challenges.rb:
--------------------------------------------------------------------------------
1 | class AddDetailsToChallenges < ActiveRecord::Migration[7.0]
2 | def change
3 | add_column :challenges, :title, :string
4 | add_column :challenges, :content, :text
5 | add_column :challenges, :price_max, :integer
6 | add_column :challenges, :deadline, :date
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20220829141529_add_devise_to_users.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddDeviseToUsers < ActiveRecord::Migration[7.0]
4 | def self.up
5 | change_table :users do |t|
6 | ## Database authenticatable
7 | t.string :email, null: false, default: ""
8 | t.string :encrypted_password, null: false, default: ""
9 |
10 | ## Recoverable
11 | t.string :reset_password_token
12 | t.datetime :reset_password_sent_at
13 |
14 | ## Rememberable
15 | t.datetime :remember_created_at
16 |
17 | ## Trackable
18 | # t.integer :sign_in_count, default: 0, null: false
19 | # t.datetime :current_sign_in_at
20 | # t.datetime :last_sign_in_at
21 | # t.string :current_sign_in_ip
22 | # t.string :last_sign_in_ip
23 |
24 | ## Confirmable
25 | # t.string :confirmation_token
26 | # t.datetime :confirmed_at
27 | # t.datetime :confirmation_sent_at
28 | # t.string :unconfirmed_email # Only if using reconfirmable
29 |
30 | ## Lockable
31 | # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
32 | # t.string :unlock_token # Only if unlock strategy is :email or :both
33 | # t.datetime :locked_at
34 |
35 |
36 | # Uncomment below if timestamps were not included in your original model.
37 | # t.timestamps null: false
38 | end
39 |
40 | add_index :users, :email, unique: true
41 | add_index :users, :reset_password_token, unique: true
42 | # add_index :users, :confirmation_token, unique: true
43 | # add_index :users, :unlock_token, unique: true
44 | end
45 |
46 | def self.down
47 | # By default, we don't want to make any assumption about how to roll back a migration when your
48 | # model already existed. Please edit below which fields you would like to remove in this migration.
49 | raise ActiveRecord::IrreversibleMigration
50 | end
51 | end
52 |
--------------------------------------------------------------------------------
/db/migrate/20220831095635_create_active_storage_tables.active_storage.rb:
--------------------------------------------------------------------------------
1 | # This migration comes from active_storage (originally 20170806125915)
2 | class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
3 | def change
4 | # Use Active Record's configured type for primary and foreign keys
5 | primary_key_type, foreign_key_type = primary_and_foreign_key_types
6 |
7 | create_table :active_storage_blobs, id: primary_key_type do |t|
8 | t.string :key, null: false
9 | t.string :filename, null: false
10 | t.string :content_type
11 | t.text :metadata
12 | t.string :service_name, null: false
13 | t.bigint :byte_size, null: false
14 | t.string :checksum
15 |
16 | if connection.supports_datetime_with_precision?
17 | t.datetime :created_at, precision: 6, null: false
18 | else
19 | t.datetime :created_at, null: false
20 | end
21 |
22 | t.index [ :key ], unique: true
23 | end
24 |
25 | create_table :active_storage_attachments, id: primary_key_type do |t|
26 | t.string :name, null: false
27 | t.references :record, null: false, polymorphic: true, index: false, type: foreign_key_type
28 | t.references :blob, null: false, type: foreign_key_type
29 |
30 | if connection.supports_datetime_with_precision?
31 | t.datetime :created_at, precision: 6, null: false
32 | else
33 | t.datetime :created_at, null: false
34 | end
35 |
36 | t.index [ :record_type, :record_id, :name, :blob_id ], name: :index_active_storage_attachments_uniqueness, unique: true
37 | t.foreign_key :active_storage_blobs, column: :blob_id
38 | end
39 |
40 | create_table :active_storage_variant_records, id: primary_key_type do |t|
41 | t.belongs_to :blob, null: false, index: false, type: foreign_key_type
42 | t.string :variation_digest, null: false
43 |
44 | t.index [ :blob_id, :variation_digest ], name: :index_active_storage_variant_records_uniqueness, unique: true
45 | t.foreign_key :active_storage_blobs, column: :blob_id
46 | end
47 | end
48 |
49 | private
50 | def primary_and_foreign_key_types
51 | config = Rails.configuration.generators
52 | setting = config.options[config.orm][:primary_key_type]
53 | primary_key_type = setting || :primary_key
54 | foreign_key_type = setting || :bigint
55 | [primary_key_type, foreign_key_type]
56 | end
57 | end
58 |
--------------------------------------------------------------------------------
/db/migrate/20220831100114_add_image_to_users.rb:
--------------------------------------------------------------------------------
1 | class AddImageToUsers < ActiveRecord::Migration[7.0]
2 | def change
3 | add_column :users, :image_url, :string
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20220901112950_addingcoordinates.rb:
--------------------------------------------------------------------------------
1 | class Addingcoordinates < ActiveRecord::Migration[7.0]
2 | def change
3 | add_column :challenges, :latitude, :float
4 | add_column :challenges, :longitude, :float
5 |
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20220901113442_add_location.rb:
--------------------------------------------------------------------------------
1 | class AddLocation < ActiveRecord::Migration[7.0]
2 | def change
3 | add_column :challenges, :location, :string
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20220901152701_add_city_to_challenges.rb:
--------------------------------------------------------------------------------
1 | class AddCityToChallenges < ActiveRecord::Migration[7.0]
2 | def change
3 | add_column :challenges, :cities, :string
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20220902104452_remove_image_url_from_users.rb:
--------------------------------------------------------------------------------
1 | class RemoveImageUrlFromUsers < ActiveRecord::Migration[7.0]
2 | def change
3 | remove_column :users, :image_url, :string
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20220905195945_create_comments.rb:
--------------------------------------------------------------------------------
1 | class CreateComments < ActiveRecord::Migration[7.0]
2 | def change
3 | create_table :comments do |t|
4 | t.references :user, null: false, foreign_key: true
5 | t.references :challenge, null: false, foreign_key: true
6 | t.timestamps
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20220905200231_add_content_to_comment.rb:
--------------------------------------------------------------------------------
1 | class AddContentToComment < ActiveRecord::Migration[7.0]
2 | def change
3 | add_column :comments, :comment, :string
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20220905200356_rename_comment_to_content.rb:
--------------------------------------------------------------------------------
1 | class RenameCommentToContent < ActiveRecord::Migration[7.0]
2 | def change
3 | rename_column :comments, :comment, :content
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20220928211345_add_omniauth_to_users.rb:
--------------------------------------------------------------------------------
1 | class AddOmniauthToUsers < ActiveRecord::Migration[7.0]
2 | def change
3 | add_column :users, :provider, :string
4 | add_column :users, :uid, :string
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20220928221019_add_columns_to_users.rb:
--------------------------------------------------------------------------------
1 | class AddColumnsToUsers < ActiveRecord::Migration[7.0]
2 | def change
3 | add_column :users, :image, :string
4 | add_column :users, :html_url, :string
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20220930214131_create_offers.rb:
--------------------------------------------------------------------------------
1 | class CreateOffers < ActiveRecord::Migration[7.0]
2 | def change
3 | create_table :offers do |t|
4 |
5 | t.timestamps
6 | end
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20220930215302_add_price_to_offers.rb:
--------------------------------------------------------------------------------
1 | class AddPriceToOffers < ActiveRecord::Migration[7.0]
2 | def change
3 | add_column :offers, :price, :integer
4 | add_column :offers, :date, :date
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20220930220534_add_offers_to_users.rb:
--------------------------------------------------------------------------------
1 | class AddOffersToUsers < ActiveRecord::Migration[7.0]
2 | def change
3 | add_reference :offers, :user, foreign_key: true
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20220930220602_add_offers_to_challenges.rb:
--------------------------------------------------------------------------------
1 | class AddOffersToChallenges < ActiveRecord::Migration[7.0]
2 | def change
3 | add_reference :offers, :challenge, foreign_key: true
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20221003065436_add_admin_to_users.rb:
--------------------------------------------------------------------------------
1 | class AddAdminToUsers < ActiveRecord::Migration[7.0]
2 | def change
3 | add_column :users, :admin, :boolean
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/schema.rb:
--------------------------------------------------------------------------------
1 | # This file is auto-generated from the current state of the database. Instead
2 | # of editing this file, please use the migrations feature of Active Record to
3 | # incrementally modify your database, and then regenerate this schema definition.
4 | #
5 | # This file is the source Rails uses to define your schema when running `bin/rails
6 | # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7 | # be faster and is potentially less error prone than running all of your
8 | # migrations from scratch. Old migrations may fail to apply correctly if those
9 | # migrations use external dependencies or application code.
10 | #
11 | # It's strongly recommended that you check this file into your version control system.
12 |
13 | ActiveRecord::Schema[7.0].define(version: 2022_10_03_065436) do
14 | # These are extensions that must be enabled in order to support this database
15 | enable_extension "plpgsql"
16 |
17 | create_table "active_storage_attachments", force: :cascade do |t|
18 | t.string "name", null: false
19 | t.string "record_type", null: false
20 | t.bigint "record_id", null: false
21 | t.bigint "blob_id", null: false
22 | t.datetime "created_at", null: false
23 | t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
24 | t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
25 | end
26 |
27 | create_table "active_storage_blobs", force: :cascade do |t|
28 | t.string "key", null: false
29 | t.string "filename", null: false
30 | t.string "content_type"
31 | t.text "metadata"
32 | t.string "service_name", null: false
33 | t.bigint "byte_size", null: false
34 | t.string "checksum"
35 | t.datetime "created_at", null: false
36 | t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
37 | end
38 |
39 | create_table "active_storage_variant_records", force: :cascade do |t|
40 | t.bigint "blob_id", null: false
41 | t.string "variation_digest", null: false
42 | t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
43 | end
44 |
45 | create_table "challenges", force: :cascade do |t|
46 | t.bigint "filter_id", null: false
47 | t.bigint "user_id", null: false
48 | t.datetime "created_at", null: false
49 | t.datetime "updated_at", null: false
50 | t.string "title"
51 | t.text "content"
52 | t.integer "price_max"
53 | t.date "deadline"
54 | t.float "latitude"
55 | t.float "longitude"
56 | t.string "location"
57 | t.string "cities"
58 | t.index ["filter_id"], name: "index_challenges_on_filter_id"
59 | t.index ["user_id"], name: "index_challenges_on_user_id"
60 | end
61 |
62 | create_table "comments", force: :cascade do |t|
63 | t.bigint "user_id", null: false
64 | t.bigint "challenge_id", null: false
65 | t.datetime "created_at", null: false
66 | t.datetime "updated_at", null: false
67 | t.string "content"
68 | t.index ["challenge_id"], name: "index_comments_on_challenge_id"
69 | t.index ["user_id"], name: "index_comments_on_user_id"
70 | end
71 |
72 | create_table "filters", force: :cascade do |t|
73 | t.datetime "created_at", null: false
74 | t.datetime "updated_at", null: false
75 | t.string "name"
76 | end
77 |
78 | create_table "offers", force: :cascade do |t|
79 | t.datetime "created_at", null: false
80 | t.datetime "updated_at", null: false
81 | t.integer "price"
82 | t.date "date"
83 | t.bigint "user_id"
84 | t.bigint "challenge_id"
85 | t.index ["challenge_id"], name: "index_offers_on_challenge_id"
86 | t.index ["user_id"], name: "index_offers_on_user_id"
87 | end
88 |
89 | create_table "users", force: :cascade do |t|
90 | t.datetime "created_at", null: false
91 | t.datetime "updated_at", null: false
92 | t.string "nickname"
93 | t.string "name"
94 | t.string "email", default: "", null: false
95 | t.string "encrypted_password", default: "", null: false
96 | t.string "reset_password_token"
97 | t.datetime "reset_password_sent_at"
98 | t.datetime "remember_created_at"
99 | t.string "provider"
100 | t.string "uid"
101 | t.string "image"
102 | t.string "html_url"
103 | t.boolean "admin"
104 | t.index ["email"], name: "index_users_on_email", unique: true
105 | t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
106 | end
107 |
108 | add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
109 | add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
110 | add_foreign_key "challenges", "filters"
111 | add_foreign_key "challenges", "users"
112 | add_foreign_key "comments", "challenges"
113 | add_foreign_key "comments", "users"
114 | add_foreign_key "offers", "challenges"
115 | add_foreign_key "offers", "users"
116 | end
117 |
--------------------------------------------------------------------------------
/db/seeds.rb:
--------------------------------------------------------------------------------
1 | # This file should contain all the record creation needed to seed the database with its default values.
2 | # The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
3 | #
4 | # Examples:
5 | #
6 | # movies = Movie.create([{ name: "Star Wars" }, { name: "Lord of the Rings" }])
7 | # Character.create(name: "Luke", movie: movies.first)
8 |
9 | require 'faker'
10 |
11 | Offer.destroy_all
12 | Challenge.destroy_all
13 | Filter.destroy_all
14 | User.destroy_all
15 |
16 | puts "Generating seeds..."
17 |
18 | lang = ['Java', 'Kotlin', 'Ruby', 'Javascript', 'Swift', 'Dart', 'CSS',
19 | 'HTML', 'Bash', 'XML', 'C++', 'Rust', 'Pascal', 'Fortran', 'PHP',
20 | 'Perl']
21 |
22 | title = ['Diagnostics fail to Load', 'Need a hand with Partials', 'Compilation Error', 'Runtime issue - Cannot load',
23 | "Says 'Unexpected program Termination'", 'System Failure after many repeats',
24 | 'Poor performance - Need to change framework', 'Library subroutine failure right before presentation',
25 | 'Client is not happy - Please guide', 'Fix this join us', 'Shows syntax error and nobody has information',
26 | 'Incorrect program design - Urgent', 'Stuck in infinite loop - No way out', 'Logics fail - no clue - Urgent']
27 |
28 | addresses = ['Geneva', 'Zurich', 'Bern', 'Cambridge', 'Oxford', 'Kathmandu', 'Berlin', 'Frankfurt', 'Paris', 'Bristol',
29 | 'Paris', 'Essen', 'Lyon', 'Kyiv', 'Madrid', 'Porto', 'Lisbon', 'Seville', 'Palermo', 'Vienna', 'Delhi',
30 | 'San Francisco', 'Washington', 'Nairobi', 'Melbourne', 'Canberra', 'Montreal', 'Beijing', 'Tokyo',
31 | 'Mumbai', 'Osaka', 'Istanbul', 'Rio de Janeiro', 'Jakarta', 'Chicago']
32 |
33 | array = ["https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80",
34 | "https://images.unsplash.com/photo-1558287340-ac154cb1b31b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=927&q=80",
35 | "https://images.unsplash.com/photo-1552162864-987ac51d1177?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80",
36 | "https://images.unsplash.com/photo-1514501259756-f4b6fbeffa67?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80",
37 | "https://images.unsplash.com/photo-1595273185163-347066c49ad3?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80",
38 | "https://images.unsplash.com/photo-1592158169526-9deda479afce?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=860&q=80",
39 | "https://images.unsplash.com/photo-1534330786040-317bdb76ccff?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=917&q=80",
40 | "https://images.unsplash.com/photo-1584308972272-9e4e7685e80f?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80",
41 | "https://images.unsplash.com/photo-1596935884412-2caade8438a8?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80",
42 | "https://images.unsplash.com/photo-1485206412256-701ccc5b93ca?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=894&q=80",
43 | "https://images.unsplash.com/photo-1605087880595-8cc6db61f3c6?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80",
44 | "https://images.unsplash.com/photo-1547212371-eb5e6a4b590c?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80",
45 | "https://images.unsplash.com/photo-1597004897768-c503466472cc?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80",
46 | "https://images.unsplash.com/photo-1597223557154-721c1cecc4b0?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80",
47 | "https://images.unsplash.com/photo-1534126416832-a88fdf2911c2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80",
48 | "https://images.unsplash.com/photo-1542909168-82c3e7fdca5c?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80",
49 | "https://images.unsplash.com/photo-1532318065232-2ba7c6676cd5?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=923&q=80",
50 | "https://images.unsplash.com/photo-1526382925646-27b5eb86796e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80",
51 | "https://images.unsplash.com/photo-1579503841516-e0bd7fca5faa?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80",
52 | "https://images.unsplash.com/photo-1536792414922-14b978901fcd?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80",
53 | "https://images.unsplash.com/photo-1515175704145-8a06ffce6b77?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=896&q=80",
54 | "https://images.unsplash.com/photo-1608153488161-803b502750fc?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80",
55 | "https://images.unsplash.com/photo-1595897952944-878f3abafb5a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80",
56 | "https://images.unsplash.com/photo-1558216144-fef86b75da36?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80",
57 | "https://images.unsplash.com/photo-1562045726-c54c4d58b602?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80",
58 | "https://images.unsplash.com/photo-1601234699404-4867fa71f87f?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=865&q=80",
59 | "https://images.unsplash.com/photo-1585837146751-a44118595680?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=858&q=80",
60 | "https://images.unsplash.com/photo-1541576980233-97577392db9a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=884&q=80",
61 | "https://images.unsplash.com/photo-1571988654190-ef2bfb6fb147?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80",
62 | "https://images.unsplash.com/photo-1592334873219-42ca023e48ce?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=861&q=80",
63 | "https://images.unsplash.com/photo-1585042570881-d5c0cb418ed8?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80",
64 | "https://images.unsplash.com/photo-1527980965255-d3b416303d12?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80",
65 | "https://images.unsplash.com/photo-1534644586429-7681a71bc591?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80",
66 | "https://images.unsplash.com/photo-1509112756314-34a0badb29d4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=931&q=80",
67 | "https://images.unsplash.com/photo-1513091550446-33297bfca05b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80",
68 | "https://images.unsplash.com/photo-1529068755536-a5ade0dcb4e8?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=881&q=80"]
69 |
70 | content = ['Here is a piece of code that shows some very peculiar behavior. For some strange reason, sorting the
71 | data (before the timed region) miraculously makes the loop almost six times faster. (Sorting itself takes
72 | more time than this one pass over the array, so it is not actually worth doing if we needed to calculate
73 | this for an unknown array). My first thought was that sorting brings the data into the cache, but then I
74 | thought how silly that was because the array was just generated.', "What are the stack and heap?
75 | Where are they located physically in a computer's memory? To what extent are they controlled by the OS or
76 | language run-time? What is their scope? What determines their sizes? What makes one faster?", "How do I
77 | toggle the visibility of an element using .hide(), .show(), or .toggle()? How do I test if an element is
78 | visible or hidden?", "Recently, I ran some of my code through Crockford's JSLint, and it gave the following
79 | error: 'Problem at line 1 character 1: Missing 'use strict' statement'. Doing some searching, I realized
80 | that some people add 'use strict'; into their code. Once I added the statement, the error stopped appearing.
81 | Unfortunately, Google did not reveal much of the history behind this string statement. Certainly it must
82 | have something to do with how it is interpreted by the browser, but I have no idea what the effect would be.
83 | So what is 'use strict'; all about, what does it imply, and is it still relevant? Do any of the current
84 | browsers respond to the 'use strict'; string or is it for future use?", "How would you explain closures to
85 | someone with a knowledge of the concepts they consist of (for example functions, variables and the like),
86 | but does not understand closures themselves? I have seen the Scheme example given on Wikipedia, but
87 | unfortunately it did not help.", "I am planning to execute a shell script on a remote server using Ansible
88 | playbook.
89 | blank test.sh file:
90 | touch test.sh
91 | Playbook:
92 | ---
93 | - name: Transfer and execute a script.
94 | hosts: server
95 | user: test_user
96 | sudo: yes
97 | tasks:
98 | - name: Transfer the script
99 | copy: src=test.sh dest=/home/test_user mode=0777
100 | - name: Execute the script
101 | local_action: command sudo sh /home/test_user/test.sh
102 | When I run the playbook, the transfer successfully occurs but the script is not executed.", "I have a
103 | long-running docker build process, so I would prefer not to disable caching for the entire build
104 | (with --no-cache). However, I would like to invalidate caching for a particular step.
105 |
106 | I had a bright idea: remove the cached layer and rebuild so this has to rebuild.
107 |
108 | I used:
109 |
110 | docker build --progress=plain
111 | to get hold of the sha of the cached layer:
112 |
113 | #16 [stage-9 3/15] RUN pip install -r /tmp/requirements.lock
114 | #16 sha256:e4ac79a1eac5702cd296ccf33a1cfa2e0c3890c77d42737dc62a3b26ac3e798e
115 | #16 CACHED
116 | But then I got this error
117 |
118 | > docker rmi e4ac79a1eac5702cd296ccf33a1cfa2e0c3890c77d42737dc62a3b26ac3e798
119 | Error: No such image: e4ac79a1eac5702cd296ccf33a1cfa2e0c3890c77d42737dc62a3b26ac3e798
120 | Is there an (easy) way of deleting this layer?
121 |
122 | Note: For most use cases (and maybe even this one) you might like to use the --no-cache option for docker
123 | build"]
124 |
125 | filter_array = []
126 |
127 | # lang.size.times do
128 | lang.each do |filter|
129 | filter = Filter.new(name: filter)
130 | filter.save!
131 | filter_array << filter
132 | end
133 |
134 | user_array = []
135 |
136 | 20.times do
137 | puts "Creating users!"
138 | user = User.new(nickname: Faker::Name.first_name,
139 | name: Faker::Name.name,
140 | email: Faker::Internet.email,
141 | password: "123456")
142 | user.photo.attach(io: URI.open(array.sample), filename: "profile.png", content_type: "image/png")
143 | user.save!
144 | user_array << user
145 | end
146 |
147 | 50.times do
148 | puts "Creating challenges!"
149 | challenge = Challenge.new(title: title.sample,
150 | content: content.sample,
151 | price_max: rand(100),
152 | deadline: Faker::Date.between(from: '2022-09-10', to: '2022-12-31'),
153 | filter: filter_array.sample,
154 | user: user_array.sample,
155 | location: addresses.sample)
156 | challenge.save!
157 | end
158 |
159 | puts "Seeds added..."
160 |
--------------------------------------------------------------------------------
/lib/assets/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EleoXDA/Dev.Work_RB/04abd63617f115b88cbfe7fd564fc30b55e74366/lib/assets/.keep
--------------------------------------------------------------------------------
/lib/tasks/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EleoXDA/Dev.Work_RB/04abd63617f115b88cbfe7fd564fc30b55e74366/lib/tasks/.keep
--------------------------------------------------------------------------------
/lib/templates/erb/scaffold/_form.html.erb:
--------------------------------------------------------------------------------
1 | <%# frozen_string_literal: true %>
2 | <%%= simple_form_for(@<%= singular_table_name %>) do |f| %>
3 | <%%= f.error_notification %>
4 | <%%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %>
5 |
6 |
7 | <%- attributes.each do |attribute| -%>
8 | <%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %>
9 | <%- end -%>
10 |
11 |
12 |
13 | <%%= f.button :submit %>
14 |
15 | <%% end %>
16 |
--------------------------------------------------------------------------------
/log/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EleoXDA/Dev.Work_RB/04abd63617f115b88cbfe7fd564fc30b55e74366/log/.keep
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "app",
3 | "private": "true",
4 | "dependencies": {
5 | "@hotwired/stimulus": "^3.1.0",
6 | "@hotwired/turbo-rails": "^7.1.3",
7 | "@mapbox/mapbox-gl-geocoder": "^5.0.1",
8 | "@popperjs/core": "^2.11.6",
9 | "bootstrap": "^5.2.0",
10 | "webpack": "^5.74.0",
11 | "webpack-cli": "^4.10.0"
12 | },
13 | "scripts": {
14 | "build": "webpack --config webpack.config.js"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/public/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
The page you were looking for doesn't exist (404)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
The page you were looking for doesn't exist.
62 |
You may have mistyped the address or the page may have moved.
63 |
64 |
If you are the application owner check the logs for more information.
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/public/422.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
The change you wanted was rejected (422)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
The change you wanted was rejected.
62 |
Maybe you tried to change something you didn't have access to.
63 |
64 |
If you are the application owner check the logs for more information.
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/public/500.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
We're sorry, but something went wrong (500)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
We're sorry, but something went wrong.
62 |
63 |
If you are the application owner check the logs for more information.
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/public/apple-touch-icon-precomposed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EleoXDA/Dev.Work_RB/04abd63617f115b88cbfe7fd564fc30b55e74366/public/apple-touch-icon-precomposed.png
--------------------------------------------------------------------------------
/public/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EleoXDA/Dev.Work_RB/04abd63617f115b88cbfe7fd564fc30b55e74366/public/apple-touch-icon.png
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EleoXDA/Dev.Work_RB/04abd63617f115b88cbfe7fd564fc30b55e74366/public/favicon.ico
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
2 |
--------------------------------------------------------------------------------
/storage/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EleoXDA/Dev.Work_RB/04abd63617f115b88cbfe7fd564fc30b55e74366/storage/.keep
--------------------------------------------------------------------------------
/test/application_system_test_case.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
4 | driven_by :selenium, using: :chrome, screen_size: [1400, 1400]
5 | end
6 |
--------------------------------------------------------------------------------
/test/channels/application_cable/connection_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase
4 | # test "connects with cookies" do
5 | # cookies.signed[:user_id] = 42
6 | #
7 | # connect
8 | #
9 | # assert_equal connection.user_id, "42"
10 | # end
11 | end
12 |
--------------------------------------------------------------------------------
/test/controllers/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EleoXDA/Dev.Work_RB/04abd63617f115b88cbfe7fd564fc30b55e74366/test/controllers/.keep
--------------------------------------------------------------------------------
/test/controllers/challenges_controller_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class ChallengesControllerTest < ActionDispatch::IntegrationTest
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/controllers/filters_controller_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class FiltersControllerTest < ActionDispatch::IntegrationTest
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/controllers/offers_controller_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class OffersControllerTest < ActionDispatch::IntegrationTest
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/controllers/users_controller_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class UsersControllerTest < ActionDispatch::IntegrationTest
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/fixtures/files/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EleoXDA/Dev.Work_RB/04abd63617f115b88cbfe7fd564fc30b55e74366/test/fixtures/files/.keep
--------------------------------------------------------------------------------
/test/helpers/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EleoXDA/Dev.Work_RB/04abd63617f115b88cbfe7fd564fc30b55e74366/test/helpers/.keep
--------------------------------------------------------------------------------
/test/integration/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EleoXDA/Dev.Work_RB/04abd63617f115b88cbfe7fd564fc30b55e74366/test/integration/.keep
--------------------------------------------------------------------------------
/test/mailers/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EleoXDA/Dev.Work_RB/04abd63617f115b88cbfe7fd564fc30b55e74366/test/mailers/.keep
--------------------------------------------------------------------------------
/test/models/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EleoXDA/Dev.Work_RB/04abd63617f115b88cbfe7fd564fc30b55e74366/test/models/.keep
--------------------------------------------------------------------------------
/test/models/challenge_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class ChallengeTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/models/comment_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class CommentTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/models/filter_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class FilterTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/models/offer_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class OfferTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/models/user_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class UserTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/policies/challenge_policy_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class ChallengePolicyTest < ActiveSupport::TestCase
4 | def test_scope
5 | end
6 |
7 | def test_show
8 | end
9 |
10 | def test_create
11 | end
12 |
13 | def test_update
14 | end
15 |
16 | def test_destroy
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/test/policies/offer_policy_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class OfferPolicyTest < ActiveSupport::TestCase
4 | def test_scope
5 | end
6 |
7 | def test_show
8 | end
9 |
10 | def test_create
11 | end
12 |
13 | def test_update
14 | end
15 |
16 | def test_destroy
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/test/system/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EleoXDA/Dev.Work_RB/04abd63617f115b88cbfe7fd564fc30b55e74366/test/system/.keep
--------------------------------------------------------------------------------
/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | ENV["RAILS_ENV"] ||= "test"
2 | require_relative "../config/environment"
3 | require "rails/test_help"
4 |
5 | class ActiveSupport::TestCase
6 | # Run tests in parallel with specified workers
7 | parallelize(workers: :number_of_processors)
8 |
9 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
10 | fixtures :all
11 |
12 | # Add more helper methods to be used by all tests here...
13 | end
14 |
--------------------------------------------------------------------------------
/tmp/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EleoXDA/Dev.Work_RB/04abd63617f115b88cbfe7fd564fc30b55e74366/tmp/.keep
--------------------------------------------------------------------------------
/tmp/pids/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EleoXDA/Dev.Work_RB/04abd63617f115b88cbfe7fd564fc30b55e74366/tmp/pids/.keep
--------------------------------------------------------------------------------
/tmp/storage/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EleoXDA/Dev.Work_RB/04abd63617f115b88cbfe7fd564fc30b55e74366/tmp/storage/.keep
--------------------------------------------------------------------------------
/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require("path")
2 | const webpack = require("webpack")
3 |
4 | module.exports = {
5 | mode: "production",
6 | devtool: "source-map",
7 | entry: {
8 | application: "./app/javascript/application.js"
9 | },
10 | output: {
11 | filename: "[name].js",
12 | sourceMapFilename: "[file].map",
13 | path: path.resolve(__dirname, "app/assets/builds"),
14 | },
15 | plugins: [
16 | new webpack.optimize.LimitChunkCountPlugin({
17 | maxChunks: 1
18 | })
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------