Ruby On Condensing nested conditionals
by Nick,
November 12, 2008 00:40
Hi Adam. You're correct abo...
1 2 3
class PropertiesController < ApplicationController before_filter :authorise_action ...
Ruby Condensing nested conditionals
The code below works, but f...
1 2 3 4
# GET /neighbourhoods/map_filter def map_filter @map_filter_errors = nil # Stores errors related to a filter request. ...
Ruby DRY up a controller action
My Neighbourhood "map_filte...
1 2 3 4
class PropertyFilter < ActiveRecord::BaseWithoutTable attr_accessible :price_direction, :price # ...many more attributes... ...
Ruby On DRYing/shortening form proc...
by Nick,
October 30, 2008 17:25
Hey Adam, thanks for the re...
1 2 3 4
def self.filter_price(direction, price) return nil if direction.blank? or price.blank? return {:error => 'Invalid argument: direction'} unless ['at most', 'at least'].include? direction ...
Ruby DRYing/shortening form proc...
In my Rails app, the Proper...

Interesting solution, Adam!...