If a controller action responds to other formats than HTML (XML, PDF, Excel, JSON, ...), you can reach that code in...
After switching to Rails 3 you may get a LoadError with the following message when trying to use your application...
When using form_for you can give the form's target URL either as a string or an array:
I’m going to list assumptions your systems probably make about names. All of these assumptions are wrong. Try to...
You need to install the following packages before you can build the Nokogiri gem: sudo apt-get install libxml2-dev...
If you get an error message like that you are missing the Aspell files a specific language:
A good tool to generate strong passwords and secrets is "apg". You can get it with sudo apt-get install...
You need to install the following packages before you can build the Paperclip gem: sudo apt-get install imagemagick librmagick...
These steps are now part of Spreewald. This note describes a Cucumber step that lets you write this:
Note that you should disable the Java plug-in in your browsers after installation. Ubuntu >= 12.04 Java 11
When you need to delete rows from a table, and the delete conditions require a joined table, MySQL needs to...
You don't need a Rails application to use Sass. Even when you're working on a static site you...
Find conditions for scopes can be given either as an array (:conditions => ['state = ?', 'draft']) or a hash (:conditions => { 'state' => 'draft...
There are many different methods that allow mapping an Array to a Hash in Ruby. Array#to_h with a...
When Paperclip attachments should only be downloadable for selected users, there are three ways to go. The same applies to...
If you need to find all files inside a directory that were modified in the last 24 hours you can...
In modern Rails versions you can also use ActiveRecord's pluck method. User.active.pluck(:id) => [1, 5, 23, 42]
First of all: You could just use RVM which would make the pain go away. If for some reason you...
sudo apt-get install i8kutils Reboot You can now run the i8k tools such as i8kmon Setting the fan speed...
Update RubyGems and Passenger Bundler requires Rubygems >= 1.3.6. Run gem update --system if you have an older version.
Sometimes you want to fetch associations for an ActiveRecord that you already loaded, e.g. when it has deeply nested associations...
When deploying Rails applications you might have noticed that JS and CSS are not cached by all browsers.
Boolean attributes can now be set by appending "which", "that" or "who" at the end: Given there is a movie...
popthis is awesome when used with inaction_mailer. Setup inaction_mailer Install the gem: sudo gem install popthis