Skip to content

Instantly share code, notes, and snippets.

@MikeSilvis
Created June 18, 2013 15:52
Show Gist options
  • Save MikeSilvis/5806534 to your computer and use it in GitHub Desktop.
Save MikeSilvis/5806534 to your computer and use it in GitHub Desktop.
class HelloController
before_filter :find_market
def index
end
private
def find_market
@market = Market.find(params[:id])
end
end
class HelloController
def index
end
private
def market
@market ||= Market.find(params[:id])
end
helper_method :market
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment