Skip to content

Instantly share code, notes, and snippets.

@aishek
Last active August 29, 2015 14:07
Show Gist options
  • Save aishek/dc833e38bb8de1fafcb8 to your computer and use it in GitHub Desktop.
Save aishek/dc833e38bb8de1fafcb8 to your computer and use it in GitHub Desktop.
resource helper example
# app/helpers/api/v1/city_helper.rb
module Api::V1::CityHelper
def resource_city
@resource_city ||= ::City.find(params[:city_id] || params[:id])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment