Instead of running all missing migrations on your test database with rake db:migrate RAILS_ENV=test you can also...
When using state_machine you sometimes need to know whether an object may execute a certain transition. Let's take...
In order to prevent the browser from asking whether to remember the password, give a form an autocomplete attribute with...
require 'open-uri' File.open('/target/path/to/downloaded.file', "wb") do |file| file.write open('http://example.com/your.file').read end Basic Authentication
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...
Look here for informations how you can show the MySQL default character set. At first you need the Amazon RDS...
By default, Rails views escape HTML in any strings you insert. If you want to insert HTML verbatim, you need...
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...
To show the collation of your tables you have to login to the MySQL console and execute SHOW TABLE STATUS...
To show the MySQL default character set you have to login to the MySQL console and execute SHOW VARIABLES LIKE...
You can convert git commits into patch files. Those can be used to apply to a different repository [1] or...
First keep in mind that :dependent => :destroy hooks into before_destroy. So when you use other before_destroy callbacks the...
Using the jQuery adapter breaks the built-in save function of CKEditor. Phenomenon: The page is submitted correctly, but the...
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...
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...
Capybara will match elements outside of a page's tag. For example, the step definitions below match nodes in a...
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...
Using git rebase can be painful but luckily you can resort to cheating with git reset and committing anew.
The colors in Rails log files are helpful when watching them but, since they are ANSI color codes like ^[[4...