...your commits are the changes. Never use merge. You've found some code that belongs to an earlier commit in your feature branch If you already have a "final" (i.e...
git rebase -i master Move the fixup directly below the commit it belongs to. Change the "pick" in front of the fixup commit to "f". Don't touch...
...Rails code is doing the delivery you can do your usual authentication and authorization beforehand. There are few exceptions where you want to store confidential files in the public folder...
...the "space" character class For matching whitespaces in a regular expression, the most common and best-known shorthand expression is probably \s. It matches the following whitespace characters: " " (space)
Do not pass times to date attributes. Always convert times to dates when your application uses time zones. Background
Getting an entire test suite green can be a tedious task which involves frequent switches between the CLI that is...
Static error pages To add a few basic styles to the default error pages in Rails, just edit the default...
It's not a good idea to leave data objects mutable. They should behave like integers. Ruby's Data would have already enforced that. Because I used a regular...
...attr}=" do |value| if @readonly raise 'Readonly' else super(value) end end end Weird behavior changes from composed_of The method composed_of accepts the option :mapping, which is required...
...or use a more mature solution like Webpack. Modules shared between entry points always become chunks When two entry points import the same module, that module automatically a separate file...
...a way to set a minimum file size for chunking, or to control chunking behavior per import. However there is currently no configuration at all. Modules imported by multiple entry...
...I am really pleased with it -- but only on a desktop computer. Have you benchmarked the framework also on smartphones and tablets? Unfortunately I must say, that it does not...
...as a jQuery collection: let $element = $(element) An API object to call additional JavaScript behavior added by a library: var player = flowplayer($element) player.play() Framework activation layers (like Angular directives...
...confident about upgrading Rails, have a look at Rails LTS. How many update steps? Besides the Rails upgrade itself, you might also want to upgrade your other gems and upgrade...
...many cases updating to the highest subversion of the specific rails version is the best choice (e.g. when updating to rails 5 you would update to 5.2.8.12), since the most...
end end def allowed_mime_types %w(image/jpeg image/png) end end This will behave like the solution before: User#portrait will get an expected error message and the User...
When working with feature branches, stale branches pile up over time. It's best to remove them right after merge, locally and on the remote, but it is a little...
if [[ "$merged_branch_name" =~ ^(master|main|production|Fast-forward)$ ]]; then exit 0 fi # Begin output echo " " echo "> You have just merged the branch \"$merged_branch_name\" into \"$branch_name...
...with power comes responsibility. Code comments can go wrong in many ways: they may become outdated, silently move away from the code they're referring to, restate the obvious, or...
...a comment, prefer improving the code: use descriptive variable/method names, extract more variables/methods to better describe what is happening, have a simple structure. However, there are things code cannot express...
...Yourself (or DRY). In Ruby on Rails we keep our code DRY by sharing behavior by using inheritance, modules, traits or partials. When you reuse behavior you want to reuse...
...module that you include in the Cucumber world. This way the module's methods become available to all step definitions. Think of it as enhancing your Capybara API with app...
Background information about session storage in Rails Rails has a default mechanism to store the session in the CookieStore. This...
...instead of downloading and bundling font files yourself. (See below for a list of benefits.) Usage Go to fontsource.org and search for the font you want to add (or a...
...s Fontsource details page for available settings. Why? Using an NPM package has some benefits over placing fonts into your repo: All font weights and glyphs are included.
...future we will be able to transition to display: none by using the transition-behavior: allow-discrete property. This will delay the display change until the transition ends. This is...
You can use mail-tester.com to check your application's e-mails for issues that might cause e-mails to be...
...hard to understand, the helpers available differ for different versions of Rails and the behavior is subtly different. Make sure you read and understand the API before using these...
A general overview about why and how we migrate can be found under Migrating from Elasticsearch to Opensearch
...styles from the document. See Styling a Web Component for this case. Applying JavaScript behavior to new elements All client-side JavaScript frameworks comes with mechanisms to activate JavaScript behavior...
...a framework mechanism you may use customElements.define() to register your custom element's JavaScript behavior with the browser directly. A big advantage of using the browser's customElements.define() is that...
CSS transitions are a simple animation framework that is built right into browsers. No need for Javascript here. They're...
When MySQL refuses to use your index, there's a number of things that you may be doing wrong. One...
I often see the use of || to set a default value for a variable that might be nil, null or...