When a has_many association basically serves to store a list of associated strings (tags, categories, ...), it can be convenient...
Note that this card is very old. You might want to use ActiveType for your auto-coerced virtual attributes instead...
E.g. when you're using a tagging gem, you have seen virtual attributes that get and set a string array...
This step tests whether a given select option comes preselected in the HTML. There is another step to test that...
This collection of Sass mixins enables cross-browser styling (including IE with CSS3PIE) with less lines of code.
There is a problem with AJAX response handling for Rails 3 remote links and forms in Internet Explorer. This problem...
The following initializer provides an :alias => "my_route_name" option to restful routes in your route.rb. This simply makes the...
Regular spaces and non-breaking spaces are hard to distinguish for a human. Instead of using the HTML entity...
Thanks to habits engrained by Rails 2’s link_to_remote and remote_form_for, we expect that Rails 3...
If a controller action responds to other formats than HTML (XML, PDF, Excel, JSON, ...), you can reach that code in...
This returns the name (including path) of your current layout: response.layout => "layouts/admin" # inside views that are using the 'admin' layout...
In rare cases you might need something like form_for (for using form builder methods on the resulting block element...
When using form_for you can give the form's target URL either as a string or an array:
Sometimes the order in which strings appear on a page matters to you. Spreewald gives you steps like these:
If you have several submit elements (inputs or buttons with type="submit") that each cause different things to happen (e.g...
In /etc/crontab In /etc/cron.d/* In /etc/cron.hourly/* In /etc/cron.daily/* In /etc/cron.weekly/* In /etc/cron.monthly/* In the personal crontab of any user. This...
You don't need a Rails application to use Sass. Even when you're working on a static site you...
For some reason you want to define a find condition in array form. And in that condition both column name...
When using virtual attributes, the attached trait can be useful to automatically copy errors from one attribute to another.
When Paperclip attachments should only be downloadable for selected users, there are three ways to go. The same applies to...
This will show you how to create a RSS feed that the Feed Validator considers valid. Note that RSS is...
You should test the callback methods and its correct invocation in two separate tests. Understand the ActiveRecord note before you...
In a great post about named routes in Rails, path vs. url, Viget Labs ponders which variant is best used...
WMD is a simple, lightweight HTML editor for blog comments, forum posts, and basic content management. You can add WMD...