For MacOS Catalina, visit Install mysql2 on MacOS Catalina
Installing mysql2
gem errors on MacOS Mojave.
Make sure openssl
is installed on Mac via Homebrew.
<%= form_with(model: team) do |form| %> | |
<div> | |
<%= form.label :name %> | |
<%= form.text_field :name, class: "input" %> | |
</div> | |
<div> | |
<%= f.select :user_id, {}, {placeholder: "Select user"}, {class: "w-full", data: { controller: "select", select_url_value: users_path }} %> | |
</div> |
For MacOS Catalina, visit Install mysql2 on MacOS Catalina
Installing mysql2
gem errors on MacOS Mojave.
Make sure openssl
is installed on Mac via Homebrew.
The issue:
..mobile browsers will wait approximately 300ms from the time that you tap the button to fire the click event. The reason for this is that the browser is waiting to see if you are actually performing a double tap.
(from a new defunct https://developers.google.com/mobile/articles/fast_buttons article)
touch-action
CSS property can be used to disable this behaviour.
touch-action: manipulation
The user agent may consider touches that begin on the element only for the purposes of scrolling and continuous zooming. Any additional behaviors supported by auto are out of scope for this specification.
require 'mailchimp' | |
mailchimp = Mailchimp::API.new(ENV['mailchimp_api_key']) | |
mailchimp.lists.subscribe(ENV['mailchimp_list_id'], | |
{ email: '[email protected]' }, | |
{ 'FNAME' => 'First Name', 'LNAME' => 'Last Name' }, | |
'html', | |
false) | |
# So the format is: | |
# mailchimp.lists.subscribe(list_id, { email: address }, { merge_vars }, 'email type', double_optin_boolean) |
# Speed things up by not loading Rails env | |
config.assets.initialize_on_precompile = false |
module ActiveRelationExtensions | |
def find_each_with_order(options = {}) | |
find_in_batches_with_order(options) do |records| | |
records.each { |record| yield record } | |
end | |
end | |
# NOTE: any limit() on the query is overridden with the batch size | |
def find_in_batches_with_order(options = {}) |
;(function($, Pusher) { | |
/* Resets all callbacks */ | |
Pusher.prototype.reset = function() { | |
$.each(this.channels.channels, function(name, channel) { | |
channel.callbacks._callbacks = {} | |
}) | |
} | |
$(document).on('page:receive', function() { | |
$.each(Pusher.instances, function(index, instance) { |
# Main reference was lascarides' post at http://stackoverflow.com/questions/14743447/getting-pdf-from-wickedpdf-for-attachment-via-carrierwave | |
# estimate.rb | |
# ... | |
has_attached_file :pdf, | |
storage: :s3, | |
s3_credentials: { | |
access_key_id: ENV['AWS_ACCESS_KEY_ID'], | |
secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'], | |
bucket: ENV['AWS_BUCKET'] |
# Support for Rspec / Capybara subdomain integration testing | |
# Make sure this file is required by spec_helper.rb | |
# (e.g. save as spec/support/subdomains.rb) | |
def switch_to_subdomain(subdomain) | |
# lvh.me always resolves to 127.0.0.1 | |
hostname = subdomain ? "#{subdomain}.lvh.me" : "lvh.me" | |
Capybara.app_host = "http://#{hostname}" | |
end |