Regular spaces and non-breaking spaces are hard to distinguish for a human. Instead of using the   HTML entity...

alfajango.com

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

makandra dev

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

emphaticsolutions.com

In a great post about named routes in Rails, path vs. url, Viget Labs ponders which variant is best used...

wmd-editor.com

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

makandra dev
w3.org

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' }

makandra dev

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

makandra dev

Update RubyGems and Passenger Bundler requires Rubygems >= 1.3.6. Run gem update --system if you have an older version.

Sometimes files attain executable-flags that they do not need, e.g. when your Windows VM copies them over a Samba...

Use this if you want to show or hide part of a form if certain options are selected or boxes...