stackoverflow.com

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

rubyinside.com

While 2.0 will include a number of syntax changes, new features and general improvements, mentioned below, it is anticipated to...

First keep in mind that :dependent => :destroy hooks into before_destroy. So when you use other before_destroy callbacks the...

ckeditor.com

Using the jQuery adapter breaks the built-in save function of CKEditor. Phenomenon: The page is submitted correctly, but the...

If you want to know the exact hits on your website (or whatever logfile you want) for a specific date...

Please note that you can break your system with this! This is not recommended. Sometimes the package repository has errors...

The most common use case for Ruby's #collect is to call a method on each list element and collect...

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

In order to monitor a Rake task using God your Rake file must write a file with its process ID...

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

RSpec lets you define the arguments with which you expect a method to be invoked: subject.should_receive(:say).with('hello...

Calling #gsub on a string that was previously marked as #html_safe will lead to unexpected behavior. E. g. backreferences...

makandra dev

If you want to stop getting notified about new messages in a Skype chat (but not leave it altogether), you...

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...

Given the problem you have a new column postion and that column should be updated for all existing rows with...

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

Defining a custom to_json method for your classes can be useful. Do it properly or you will "randomly" get...

grep -r doesn't work on Solaris. You can only grep on files in the current directory. A workaround is...

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

stackoverflow.com

Using git rebase can be painful but luckily you can resort to cheating with git reset and committing anew.

When adding a new field to your model's database table, don't set any defaults in the database.

web.archive.org

Single step and slow motion for Cucumber scenarios can come in handy, especially in @javascript scenarios. # features/support/examiners.rb AfterStep('@slow_motion...

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