...or newer versions for these libraries before you start. Maybe you can upgrade them beforehand which makes the migration easier. Here are some libraries that I had come across:
...implement the navigation on your own. Tip: Add a feature for your navigation bar beforehand and test links and their highlighting (don't forget dropdown submenus!). After upgrading to Bootstrap...
...move elements to the back (e.g. background images, gradients etc). They will be rendered behind all other elements within the context (e.g. text), but not behind elements outside the stacking...
ActiveSupport (since 4.1) includes test helpers to manipulate time, just like the Timecop gem: To freeze the current time, use...
Today I learned that you can animate HTML elements using the Web Animation API's method .animate(keyframes, options) (which...
Tempfiles get deleted automatically With the the ruby Tempfile class you can create temporary files. Those files only stick around...
When deleting a record in your Rails app, Carrierwave automatically takes care of removing all associated files. However, the file...
The value of the Unicode byte-order character placed at the beginning of the file (BOM). The value given by the charset attribute of the Content-Type...
...in an encrypted YAML file. Usage is simple: each key in the credentials file becomes a method on Rails.application.credentials, returning the corresponding secret. # Credentials file file_storage_secret: superstrongsecret
...would possibly need in a clean way, I prefer to simply always use them. Behind the scenes, Open3 actually just uses Ruby's spawn command, but gives you a much...
Open3.capture3 Basic usage is require 'open3' stdout_str, error_str, status = Open3.capture3('/some/binary', 'with', 'some', 'args') if status.success? # okay else raise "did not work" end Open3 will raise...
TL;DR Append your locale keys with _html to have them marked as html_safe and translate them with = t...
...for all exceptions (previously true) :none: It will raise for all exceptions (previous default behavior, value false) Using the new default needs to change a RSpec test like this:
available for button, fieldset, input, select, textarea, command, keygen, optgroup, option Browser specific behavior: IE 11: text inputs that are descendants of a disabled fieldset appear disabled but the...
Deep dive Okay, so the example above has at least one obvious benefit: You do not have to put self.table_name_prefix = "universe_" into each of your classes...
...it. It's not read at all. Here is why (follow links for a better understanding): An ActiveRecord class will pick the table_name_prefix of any of its module...
Your development server is usually running on an insecure HTTP connection which is perfectly fine for development.
CarrierWave comes with a set of default configuration options which make sense in most cases. However, you should review these...
...will be short a window manager. This might be fixable, but it's probably best to simply log out (or shut down) using the Gnome panel...
...when the model has no database or database columns yet. Example: class Post < ApplicationRecord begin # Magically auto-strips all string attributes columns.each do |column| next if [:string, :text].exclude?(column.type...
Any form fields where users enter numbers should be an . Numeric inputs have several benefits over : On mobile or tablet devices, number fields show a special virtual keyboard that shows...
Rails default config uses the ActiveSupport::Cache::NullStore and disables controller caching for all environments except production: config.action_controller.perform_caching = false...
PostgreSQL's Common Table Expressions (CTEs) can be used to extract sub-queries from bulky SQL statements into a temporary...
> {% client.global.set("auth_token", response.body.token); %} ### //Accessing a variable GET https://example.com/api Authorization: Bearer {{auth_token}} Complete documentation can be found here: https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html
This card tries to summarize by example the different uses of heredoc. In Ruby << vs. <<- vs. <<~ In Rails strip_heredoc...
...gitignore, see https://makandracards.com/makandra/15947 [diff] algorithm = patience # A slower algorithm that sometimes produces better diffs [fetch] prune = true # Remove local remote-tracking branches that have been deleted [rebase]
main-view = date:relative author:abbreviated commit-title:graph=true,refs:true A better diff tool You may switch to delta, a fancy diff tool with syntax highlighting and...
In a JavaScript console, type this: > 9112347935156469760 9112347935156470000 Ooops. And that's not a float! This occurs because JavaScript uses...