Rails Errors

Rails error pages are FANTASTIC…when you understand what the heck that gibberish is all about.
This stack is for interpreting Rails error pages. We learn from our mistakes. This will likely not be the last time you see this particular flavor of error. When you get an error page, and something clicks in your mind, capture it. Translate what the error is really telling you. When looking at a Rails error with a mentor or senior developer, ask them to explain what they see in the error. What are the cues, the key terms and phrases, and how do they leverage this information to resolve the issue.

Benchmarking in the Rails Console

06/16/20  Public, Rails Errors, Ruby General

timing = Benchmark.measure { Post.all }

The various attributes of the object returned (Benchmark::Tms) are provided here.

Here is a sample applicati...

1 vote - harrylevine

Create a Rails path helper link to a specific anchor tag section of a page

06/13/20  Public, Rails Errors

admin_company_settings_path(anchor: 'autopilot-mode')

#=> /admin/company_settings#autopilot-mode

Links to that page, scrolled to the DOM element containing id="autopilot-mode"

1 vote - harrylevine

Tail the test / spec logs

03/06/20  Public, Rails Errors

In a separate tab run:

$ tail -f log/test.log

1 vote - harrylevine

Code review comments

01/31/20  Public, Rails Errors, Ruby General

instance variables / getters / setters

re: @redis

In general for getters and setters in our classes. Can we:

  1. limit the usage of instance variables to setters (@redis), i.e. where we are assigning things, and
  2. use an `attr_...

1 vote - harrylevine

before_* callbacks rollback transactions if its method returns false

10/05/16  Public, Rails Errors, Troubleshooting

I had a form, where in one of the fields, the user was clicking a drop-down menu, and choosing between one of three choices.

After the form was submitted, I had a callback that was doing something to the record.

When the user selected op...

1 vote - harrylevine