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...
Expiration of Rails sessions By default Rails sessions expire when the user closes her browser window. To change this edit...
The following Haml will do: %head{ :profile => 'http://www.w3.org/2005/10/profile' } %link{ :href => image_path('favicon.ico'), :rel => 'icon', :type => 'image/vnd.microsoft.icon' }
There are two distinct ways of commenting Haml markup: HTML and Ruby. HTML comments This will create an HTML comment...
To return non-HTML responses (like XLS spreadsheets), we usually use the respond_to do |format| format.xls do # send spreadsheet...