You can use text-overflow to truncate a text using CSS but it does not fit fancy requirements.

When using Rails to truncate strings, you may end up with strings that are still too long for their container...

The step definition below lets you say: Then I should see a field "Password" But I should not see a...

Most of the JavaScript snippets have code that manipulates the DOM. For that reason dom manipulating javascript code should have...

Views are normally (for good reason) not rendered in controller specs. If you need it to happen, use:

makandra dev

I have no idea how it's supposed to work (or why the don't have a print CSS), but...

stackoverflow.com

Though Internet Explorer 9 supports the box-shadow CSS property there is a nasty bug which sometimes prevents it from...

When you print out a HTML pages, all raster images (like PNGs) will appear aliased. This is because a printer...

Although it's tempting flirt with detecting mobile/touch devices with CSS media queries or Javascript feature detection alone, this approach...

makandra dev

When you're getting this error, one possibility is that you've created a select field for an association instead...

One of the most common production errors are ActionController::MethodNotAllowed errors. They usually happen when someone reloads a form by...

Submit buttons in Rails come with a useful option :disable_with which will disable the button when clicked and change...

makandra dev

When you use one line Ruby comments in ERB templates you should never do this (notice the whitespace in front...

hacks.mozilla.org

Since Firefox 8 it is possible to define custom context menus (right clicking) with HTML markup.

If you would like to use language specific layout (e.g. background-images) in your applications stylesheets you can achieve this...

In order to prevent the browser from asking whether to remember the password, give a form an autocomplete attribute with...

Forms with many inputs (600+ in my case) become extremely unresponsive on an iPad, up to the point where it...

There are several options, but most of them are impractical. The best way is to use the :ruby filter:

Back in the war, Rails developers had to manually HTML-escape user-supplied text before it was rendered in a...

Clearfix is a hack to clear floating elements without additional HTML markup. If you only need to support IE8 and...

RSpec 1 (Rails 2) With the most recent spec_candy.rb helpers you can say: User.stub_any_instance(:foo => :bar) user = User.new...

ckeditor.com

Using the jQuery adapter breaks the built-in save function of CKEditor. Phenomenon: The page is submitted correctly, but the...

Generally for nested forms, a blank form is placed below all other existing object forms. If you would like to...

blog.bitcrowd.net

Recently, we had an interesting lunch-break with the rails 3.1. asset-pipeline in production mode. Daniel Zahn made a...