Skip to content

Instantly share code, notes, and snippets.

@amite
Created January 5, 2013 15:34
Show Gist options
  • Save amite/4462115 to your computer and use it in GitHub Desktop.
Save amite/4462115 to your computer and use it in GitHub Desktop.
class GearController < ApplicationController
before_filter :find_gear
private
def find_gear
@gear = Gear.type(params[:type].to_s.singularize).where(:reference => params[:id]).first if params[:id]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment