If you have the following deprecation warning after upgrading to rails >= 2.3.10 DEPRECATION WARNING: The :overwrite_params option is deprecated. Specify all the necessary parameters instead. that is for example...
This will only work with warnings that go through ActiveSupport and only in Rails 3.0 or higher...
...your console prompt so you don't accidentally break production Officially supporting IRB (standard rails console) and pry (via pry-rails gem). Example: $ rails console Loading development environment (Rails...
...the gem. The gem is there for you should you one day upgrade to Rails 3.2+. Please don't use the defaults gem which we original forked away from in...
A couple of Railsconfs ago, Courtenay and I did indeed discuss
Katapult 0.3.0 brings Rails 5 and Ruby 2.5 support with a new design, plus a ton of smaller features, fixes and improvements. Features Generating a Rails 5.1.4 app on Ruby...
To simulate Rails' to_sentence in your JavaScript application, you can use these few lines of CoffeeScript code: joinSentence = (array) -> if array.length > 1 array[0..-2].join(', ') + ', and ' + array...
...staging or production environments, chances are that JavaScript compression is the culprit. By default, Rails 3.2 compresses JavaScript with UglifyJS. I have seen a few cases where this actually breaks...
...reload the page, log into the site and reload the cookie information site. For Rails powered sites, you should see a cookie named '_your_site_session' and -- depending on your...
...the need for manual intervention that might destabilize or even crash the application. As Rails does not set a timeout on database statements by default, the following query will run...
...statement_timeout"=>"10s"}] begin ActiveRecord::Base.connection.execute("SELECT pg_sleep(15)") rescue ActiveRecord::QueryCanceled => e Rails.logger.error("Query was canceled: #{e.message}") end Adjust or disable the timeout for a single transaction:
Using Scenic, you can bring the power of SQL views to your Rails application without having to switch your schema format to SQL. Scenic provides a convention for versioning views...
...for features. If you don't have separate environments, you can't check your Rails.env. I managed to distinguish between specs and features by asking Capybara. Note that this only...
...the need to enter user and password, you can say the following in any Rails 2 project: script/dbconsole -p In Rails 3 you can say: rails dbconsole -p
Gem to get Rails 3's new ActiveRecord query interface (where, order) and the new scope syntax (chaining scope definitions) in Rails 2. You also get #to_sql for scopes...
...different take on what we're doing with ActiveType. Since it lives under the rails organization it might be part of Rails...
EdgeRider 0.3.0 adds support for Rails 4.1 and Ruby 2.1. It forward-ports ActiveRecord::Base.scoped to Rails...
In an environment: config.logger = Logger.new('/dev/null')
Very detailed guide to caching Ruby on Rails. Goes well with the official Rails guide on caching...
With the impending release of Ruby on Rails 4, it looks like a lot of developers will be updating their web applications in the coming new year.
...a series of blog posts going over everything you will need to know about Rails 4 for an effortless upgrade...
Sometimes the Rails helper #distance_of_time_in_words is using too much magic. When you need a time difference in a specific unit, use this method: ^ def distance_of...
I recently experienced the error ActiveRecord::StatementInvalid: Mysql2::Error: closed MySQL connection. Apparently this happens when there is a timeout...
...row becomes expensive The linked article shows how to create a partial index with Rails...
How to remove/disable the automatic XSS protection helper html escaping for Rails 3. This is probably a horrible idea...
...attached link for a way to extract the conditions of a named scope in Rails...