Send email asynchroniously using Sidekiq.
Create your mailer us usual:
| # app/models/experience.rb | |
| # | |
| # == Schema Information | |
| # | |
| # Table name: experiences | |
| # | |
| # id :integer not null, primary key | |
| # title :string | |
| # description :text | |
| # created_at :datetime not null |
gem 'browserify-rails', '1.5.0' # until fix: https://github.com/browserify-rails/browserify-rails/issues/101
gem 'react-rails'Browserify-rails allows to use browserify within assets pipeline. React-rails is here only to allow to use #react_component (and thus, prerendering).
Note that jquery-rails can be removed from Gemfile, the npm version of jquery and jquery-ujs will be used instead.
| # Caches Arbre elements in the `Rails.cache`. | |
| # | |
| # Yielding the first time adds to the output buffer regardless of the | |
| # returned value. A cache miss must be handled separately from a hit | |
| # to avoid double rendering. | |
| # | |
| # Returns yielded Arbre on cache miss OR an HTML string wrapped in | |
| # an text node on cache hit. | |
| def cache_arbre(context, *args, &block) | |
| if controller.perform_caching |
| # app/jobs/example_job.rb | |
| class ExampleJob < ActiveJob::Base | |
| queue_as :default | |
| rescue_from(ActiveRecord::RecordNotFound) do | |
| retry_job wait: 1.minute, queue: :default | |
| end | |
| def perform(param_1, param_2) |
| FROM ruby:2.4-alpine | |
| ENV PATH /root/.yarn/bin:$PATH | |
| RUN apk update && apk upgrade && \ | |
| apk add --no-cache bash git openssh build-base nodejs tzdata | |
| RUN apk update \ | |
| && apk add curl bash binutils tar gnupg \ | |
| && rm -rf /var/cache/apk/* \ |
| require "selenium/webdriver" | |
| Capybara.register_driver :chrome do |app| | |
| Capybara::Selenium::Driver.new(app, browser: :chrome) | |
| end | |
| Capybara.register_driver :headless_chrome do |app| | |
| capabilities = Selenium::WebDriver::Remote::Capabilities.chrome( | |
| chromeOptions: { args: %w(headless disable-gpu) } | |
| ) |
My setup for configuring a Rails app with RSpec Feature tests that uses Capabara to test on a browserstack remote browser.
The browserstack docs only show either an RSpec or a Capabara setup.
What I wanted:
If you have your code defined in classes in lib/ folder you may have problems to load that code in production.
Autoloading is disabled in the production environment by default because of thread safety.
Change config/application.rb:
config.autoload_paths << Rails.root.join("lib")
config.eager_load_paths << Rails.root.join("lib")
To enable TrueColor for Tmux, you must make sure that you have two things:
tmux -V