Show: All | News Items | Blog Posts
Dynamic Select Menus in Rails using Observe_Field
Mar 16, 2010 by Charlie
I frequently find myself building forms which contain dynamic select menus. This means that a user selects a choice from one menu, and that choice populates options into a second menu. An example of this might be a scenario where the user selects their state from a drop-down menu, then selects their city from a second menu. We only want that second menu to contain citie...
Form Validation vs. Correction in Rails
Dec 17, 2008 by Charlie
Developers have a great deal of control over a web user's experience, and when it comes to validating input forms, opportunities to make things smoother for the user are something every good developer should think about. For example, I am working on a project right now where users can enter the URL of a link into the database-driven content. In order for the link to ...
Rails Caching non HTML Files in a Different Cache Location
May 8, 2007 by Adam
We use page caching in Rails to speed up sites and improve performance. This is a great feature of Rails but can get cumbersome when trying to keep up with which pages to sweep and when. To make life easier we use a separate directory to house the cache. This solution is great for files that end in a .html extension but for other file types you need a new rewrite rule...
Rails inline ERb effects on HTML structure
Mar 20, 2007 by Travis
When using Ruby on Rails, ERb (embedded Ruby) is used a LOT in the X/HTML. There are two types of ERb, An evaluation block: <% some_code %> And an output block: <%= @print_this_variable %> These blocks are necessary when using Rails, and I've noticed that when I do a 'View Source' (via the Web Developer addon for Firefox, of course), I se...
Nov 10, 2006 by Adam
Rails page caching is without a doubt the best way to speed up your application and reduce the server load. I decided to cache some XML I was dumping out for a web service and realized that Rails will cache the document as HTML. As long as the controller handles nothing but xml you can do the following as a work-around: class LinkApiController < ApplicationCont...