If required, add more feature files in the same manner. From these, the reader should understand everything to know about the new feature you're building.
...examples you can think of:
it ' ' it ' ' it '...' end From these, the reader should understand everything to know about that method. When you're done listing examples, start...
...use on the backend. Goals After finishing this lesson you should be able to read and write simple Ruby programs. Gain an understanding of the following concepts: Working with basic...
...some tutorial to get you started with learning Ruby. You don't need to read them all. Pick some that work for you. codeacademy.com: Interactive tutorial Introduction to Programming with...
Basic validations Read the Rails Guide on ActiveRecord Validations. You should have an overview which kinds of validations are built into Rails. Also read Testing ActiveRecord validations with RSpec.
...all your validations in MovieDB. Use Shoulda matchers where you think they improve the readability your code. Working with error messages Understand how to use the #errors method to inspect...
...to all (especially larger teams), we think it is a helpful starting point. First, read the Gatekeeping for developers guide, then ask your developers to read it and follow it...
...In the row below the dev tool tabs, there's a throttling dropdown which reads "Online" by default. Inside the dropdown, you will find a few presets and an option...
...the row right below the dev tool tabs you will find an option which reads "No throtteling" by default. Pick one of the presets available there. (Almost) any application: trickle...
The lifecycle of an issue How to write an issue Issue format Read the card Project management best practices: Issues. Gatekeeping Get familiar with our Gatekeeping process.
Commit squashing (and the resulting traceability through git blame) Our Merge request checklist Read the card Before you make a merge request: Checklist for common mistakes Include the checklist...
...cards are our internal best practices and tips for our daily work. They are read worldwide by developers looking for help and tips on web development with Ruby on Rails...
...the expansion of the knowledge base. How does makandra cards work? Many of our readers stumble across our cards when they have a problem and are researching the topic in...
...only available from Rails 8. There are cases where it might be fine to read directly, like: # Okay User.find(params[:id]) This still relies on params[:id] existing, so your...
...url_for(params.to_unsafe_h)` We have an extra card on this topic. Further reading It's also worth to read Rails: Using require and permit for attributes when configuring...
...with regular expressions works differently in every language Ruby: Making your regular expressions more readable with /x Regular Expressions - Cheat Sheet ReDOS: Denial of Service attack vector on inefficient regular...
...parses a .rb file containing a simple Ruby class: # student.rb class Student < Person attr_reader :first_name, :last_name, :disabled attr_accessor :credits def full_name first_name + ' ' + last_name...
...not very future-proof: It breaks the ESM spec that demands imported modules to be read-only. It only works in some versions of Webpack (tested on Webpacker 5.4 with...
...when dependencies need approval (it is also the output of the failing licenses spec): Read on to learn what to do about the output. All decisions are written to doc/dependency_decisions.yml...
...to detect it manually. Check if current versions sport a license. Check package.json, composer.json, README. Once you know the license, tell LicenseFinder with bundle exec license_finder licenses add $DEPENDENCY...
...you think that wrapping transfer_money in a transaction would help, you should re-read this article from the top. What you should do instead is to wrap critical code...
By default, Rails views escape HTML in any strings you insert. If you want to insert HTML verbatim, you need...
...database, how many commits and rollbacks there are. You can see the how many reads hit the cache (blks_hit) and how many had to be served FROM disk (blks...
SELECT schemaname,relname,last_autovacuum,last_autoanalyze,autovacuum_count,autoanalyze_count FROM pg_stat_all_tables; Shows the number and last point in time when autovacuum and autoanalyze happened...
...only hides visually, not technically: the element is still focusable and visible to screen readers. So, how can we fade an element while maintaining accessibility? Enter visibility. It also hides...
...visibility, the hidden element is truly hidden and neither focusable nor visible to screen readers. Alternatives If you're starting your transition from JavaScript, you can give the element the...
Note This is an older video. FactoryGirl has since been renamed to FactoryBot. Read the FactoryBot Getting Started guide. Despite its name this is an in-depth guide and...
...This looks awesome, but at the risk of adding random strings to your screen. Read don't build randomness into your factories for more background. Tests should never influence each...
...we are using popular authentication libraries like clearance or devise for this task. Learn Read the article Rails Authentication from Scratch You don't need to do write any code...
...make the movies' show view only accessible for authenticated users? How does logout work? Read the documentation of clearance in preparation for the exercise below Exercise: Authentication with Clearance
Code quality can be measured in four levels: (Working code) Reliable code (minimum) Readable code (ok for short-lived code) Changeable code (standard level) The code quality of a project...
However, you should not stop here. Any piece of code is usually read may times, so please make it readable: 2. Readable code Your code is here to...
...of this and just use a plan transaction do. If you need ActiveRecord::Rollback, read on. The basic problem Not all databases support nested transactions. Therefore, Rails will sometimes silently...
...all new projects. We try to migrate legacy projects to BEM, block-by-block. Read Read the chapter "Taming Stylesheets" from our book Growing Rails Applications in Practice (in our...
...this card by skimming over the linked resource. Discussion Growing Rails applications in practice Read the following chapters from our book Growing Rails Applications in Practice: On following fashions
...about the sandboxing cycle is quite on point on this topic. After the chuckle, read these resources: Pendulum swings by Mark Seemann The Pendulum Swing of Development and Technology Trends...
...Gemfile.lock could never indicate which version of a gem was installed, i.e. the Gemfile read nokogiri (1.12.5) although nokogiri (1.12.5-x86_64-linux) might actually be installed. In addition, there...
...versions of Bundler (at least since 2.3) have two different behaviors: If your Gemfile.lock reads PLATFORMS: ruby, it might either install a compatible platform-specific version, or the plain ruby...
Rubymonk training Read the following Rubymonk articles: Ruby Primer: Ascent (archived copy) Metaprogramming Ruby (archived copy) Metaprogramming Ruby: Ascent (archived copy) For each chapter in each article:
...very powerful tool. Most notably, it allows you to represent data in a very readable manner. For example, Rails offers a compact DSL to define new routes. A big drawback...
...make custom transcoding/conversion logic working. Unless you adapt your processor, this will now fail. Read the following paragraph on why and how to fix it. The workfile_path breaking custom...
...probably why CarrierWave 3.x introduces the new behavior, below. Still, FFMPEG will then read the video file, extract the first frame image and save it to the thumbnail.jpg file...