...to e.g. lock an entire form while it is being changed. This requires code beyond database locking, in both backend and frontend...

...index: true option. Use it only inside create_table or for add_reference (= add_belongs_to) statements, and use add_index for other cases. Never use index: true but only...

kernel.org

...John Doe <user@example.com> Date: Thu Dec 23 13:37:00 2010 +0100 make everything better Once you are done bisecting you can go back with git bisect reset

...t have control of. Solutions Don't log SQL queries. This is the default behavior of rails but can be changed in the config/environment/production.rb file: config.log_level should not be...

This is painful. Consider using Microsoft Office or switching careers. If you need to write < 20 letters consider doing it...

TL;DR There are three dimensions you can control when scoping routes: path helpers, URL segments, and controller/view module.

...would allow to detect the end of windows size changing process. Capybara provides a better way to manipulate the browser window which you should use instead: page.current_window.resize_to. Good: Capybara...

...as isolated (more unit like) tests, one might want to test some cookie dependent behavior as a request, helper or model spec too. Since the rspec documentation on testing cookies...

...that into a class to DRY up your code and write solid unit tests. Beware that your class will not be able to read the cookies, since they are only...

...Rails docs, e.g. Array#to_sentence String#dasherize Hash#slice Object#presence Libraries The best way to learn about a Ruby gem, Javascript libary, etc. is often to find the...

http://unpoly.com https://lodash.com/ https://fontawesome.com/icons Web Platform (HTML, JavaScript, CSS) The best reference to look up information on HTML tags, JavaScript features or CSS properties is the...

class Post < ActiveRecord::Base has_one :attachment end # attachment.rb class Attachment < ActiveRecord::Base belongs_to :post validates :title, presence: true end Issue When creating a post with an invalid...

Performing COUNT(*) on large tables is slow. Sometimes you don’t need the exact number once results exceed a certain...

...all Unpoly updates work using AJAX requests, you won't get the more detailled better_errors page with the interactive REPL. Below is an event listener that automatically repeats the...

...full CSS and JavaScript. The code assumes you are using Ruby on Rails with better_errors, which is the default error view that modern Rails versions employ. If you are...

Some tasks in a web application are better not done live when a user request a page, but in the background. Examples are longer running tasks tasks that are not...

...been accepted for 7 days. Learn about Sidekiq Read Sidekiq's Readme Read Sidekiq best practices Read Sidekiq Error Handling Understand how to schedule jobs, and work them off

makandra Operations

JSON Web Tokens are often times used for authentication delegation from one system to another. They can be decoded for...

makandra dev

...changes you make to the database will be rolled back on exit. Warning Changes beyond the database (deleting files, sending emails, etc) cannot be rolled back...

postgresql.org

TL;DR PostgreSQL handles Rails 4+ text and string columns the same. Some libraries may still reflect on the column...

github.com

The parallel-gem is quite easy to use and can speed up rendering time if you want to render the...

...shared_examples_for can have parameters. You can simply hand over arguments from it_behaves_like: shared_examples_for 'string equaling another string' do |expected_string| it 'is equal to...

...subject).to eq(expected_string) end end describe 'some string' do subject { 'foo' } it_behaves_like 'string equaling another string', 'foo' end RSpec 1 Use it_should_act_like from...

Capybara provides execute_script and evaluate_script to execute JavaScript code in a Selenium-controlled browser. This however is not...

When users type into a Tom Select control, the options list is updated with a short delay which can feel...

In a web application you sometimes have tasks that can not be processed during a request but need to go...

When HTTP clients make an request they can define which response formats they can process. They do it by adding...

When changing the glibc version, it's possible that the upgrade also includes changes to how locales work.

When setting up cronjobs, commands somtimes output something every time. If these commands don't support limiting their output to...