Put the line below in the respective env.rb file to make your action controllers raise an ActionController::UnpermittedParameters error when...

Webpack is the future. We're using it in our latest Rails applications. For tests, we want to compile assets...

Rails default config uses the ActiveSupport::Cache::NullStore and disables controller caching for all environments except production: config.action_controller.perform_caching = false...

makandra dev

If you use the Better Errors gem, you will sometimes notice that it can be very slow. This is because...

When using GROUP BY, MySQL now complains if the SELECT includes columns which are not part of the GROUP BY...

Nowadays it is fairly easy to intercept and modify mails globally before they are sent. All you have to do...

Since Rails 5, domain models inherit from ApplicationRecord by default. This is the place to put code that should be...

Rails supports time zones, but there are several pitfalls. Most importantly because Time.now and Time.current are completely different things and...

Middleman is a static page generator that brings many of the goodies that Rails developers are used to.

Dump this method into your Ruby console to quickly print data in columns. This is helpful for e.g. comparing attributes...

Database connections are not thread-safe. That's why ActiveRecord uses a separate database connection for each thread.

makandra dev

This card compares patterns to store trees in a relation database like MySQL or PostgreSQL. Implementation examples are for the...

When you load a dump for development, records may reference images that are not available on your machine.

makandra dev

This is a visualization of the files that will be generated by some useful rails generators. Invoke a generator from...

evilmartians.com

Adding a gem means you take over the liability towards the external code. Checklist Based on "To gem, or not...

We generally use multiple application servers (at least two) and you have to search on all of them if you...

makandra dev
github.com

The rack-contrib gem brings a JSONP middleware that just works™. Whenever a JSON request has a callback parameter, it...

lists.ruby-lang.org

TruffleRuby is an experimental Ruby implementation that tries to achieve ~10x performance over MRI. This has been on our radar...

So you're getting an error like this: undefined method `activate_bin_path' for Gem:Module (NoMethodError)

Put the following into config.ru in your Rails root folder: # Require your environment file to bootstrap Rails require ::File.dirname(__FILE...

Building plain text emails with an .erb template doesn't allow you to indent code like you normally do in...

This card tries to summarize by example the different uses of heredoc. In Ruby << vs. <<- vs. <<~ In Rails strip_heredoc...

clipboardjs.com

We used zeroclipboard.js in some of our projects but now we switched to clipboard.js because it does not rely on...

solnic.eu

Yesterday I stumbled across a talk in which the guy mentioned module sub-classing. I was curious what you can...