api.rubyonrails.org

Rails offers a way to prepend (or append) view paths for the current request. This way, you can make the...

When you have string contents (e.g. a generated binary stream, or data from a remote source) that you want to...

You need to update a lof gems. Make sure you don't have any version constraints in your...

Running rails server will start a local server that you can access via http://localhost:3000. When you are working...

Use bundler > 1.15 to fix Gem::LOADED_SPECS_MUTEX (NameError). Given the following project: ruby -v ruby 1.8.7

guides.rubyonrails.org

When your Rails controller calls render, you can pass a :status option for the HTTP status code: render 'results', status...

makandra dev

When a Rails controller action should handle both HTML and JSON responses, do not use request.xhr? to decide that. Use...

makandra dev
github.com

Katapult 0.3.0 brings Rails 5 and Ruby 2.5 support with a new design, plus a ton of smaller features, fixes...

If your Rails application is using Webpack you need to serve assets on the same host as you application runs...

makandra dev

ActiveSupport::Dependencies takes care of auto-loading any classes in development. This is usually useful, but when you run into...

This is an extension to PostgreSQL vs MySQL: How to UPDATE using a JOIN. UPDATE employees SET department_name = departments.name...

TL;DR Use user.update!(remove_avatar: true) to delete attachments outside of forms. This will have the same behavior as...

This is a small example on how you can check if your Postgres index can be used by a specific...

github.com

The issue: You are using stub_const to change a constant value for your test. stub_const "SomeClass::CONST", 'test...

blog.bigbinary.com

This error is raised because your old database does not have a configured environment yet, which Rails 5 enforces.

makandra dev
makandracards.com

Rails applications and ruby gems should have a README that gives the reader a quick overview of the project. Its...

You should avoid using application models in your migrations. But how else could you create records in a migration?

postgresql.org

PostgreSQL's Common Table Expressions (CTEs) can be used to extract sub-queries from bulky SQL statements into a temporary...

PostgreSQL supports the SQL OVERLAPS operator. You can use it to test if two date ranges overlap: => SELECT ('2001-02...

relishapp.com

In most projects I know, Cucumber test suite speed is not an issue. Of course, running 350 features takes its...

github.com

When you're using Sidekiq::Web to monitor the Sidekiq status AND have your session cookie configured to a wildcard...

When attempting to update RubyGems, depending on updates your previously performed, you might run into an error ERROR: While executing...

We're usually running Ubuntu LTS versions. Sometimes newer hardware requires packages from more recent Ubuntu releases that only come...

A common pattern in Ruby is to to require all files in a specific diretory, using something like Dir.glob(Rails.root.join...