apidock.com

Using rename_column, remove_column, etc. more than once in a migration makes that migration run slower than it should...

rails-erd.rubyforge.org

Gem to generate entity relationship diagrams from your Rails 3 ActiveRecord models. The diagram style is pretty and configurable.

blog.carbonfive.com

I still see people promoting various gems and plugins to handle miscellaneous configuration elements for your application. One little known...

When you have objects in your database that hold latitude and longitude and you want to find others that are...

makandra dev

You have to specify the environment with -e env_name or RAILS_ENV=env_name if you want to run...

If you would like to use language specific layout (e.g. background-images) in your applications stylesheets you can achieve this...

In order to prevent the browser from asking whether to remember the password, give a form an autocomplete attribute with...

There are several options, but most of them are impractical. The best way is to use the :ruby filter:

After starting the Rails server in a freshly generated Rails 3.1 project you could see an error message such as...

Note: This applies specifically to MySQL. In PostgreSQL for example, this is not an issue. If you care about performance...

By default, Rails views escape HTML in any strings you insert. If you want to insert HTML verbatim, you need...

danhixon.github.com

If you encounter the error message above when running cucumber, just execute... rm rerun.txt ...in the Rails directory.

RSpec 1 (Rails 2) With the most recent spec_candy.rb helpers you can say: User.stub_any_instance(:foo => :bar) user = User.new...

stackoverflow.com

The solution in this card is based on a stack overflow post by Leventix. If you need to make request...

If you specify different ports, you can run multiple local webricks with rails server --port=300X at the same time...

The Rails logger will store its content in a buffer and write it into the file system every 1000 lines...

When your Cucumber feature seems to forget cookies / sessions when you run it with Selenium check if the test travels...

github.com

Looks simpler than inaction_mailer: gem install mailcatcher mailcatcher Setup Rails to send mails to 127.0.0.1:1025. Usually you want...

Generally for nested forms, a blank form is placed below all other existing object forms. If you would like to...

When you require the Ruby debugger to be available from your Rails console (e.g. you want to inspect a method...

In order to open a MySQL shell without the need to enter user and password, you can say the following...

In case you have sensitive data within your RDS instance, you want to use encrypted connections between your application and...

blog.bitcrowd.net

Recently, we had an interesting lunch-break with the rails 3.1. asset-pipeline in production mode. Daniel Zahn made a...

commandlinefu.com

The colors in Rails log files are helpful when watching them but, since they are ANSI color codes like ^[[4...