Skip to content

Instantly share code, notes, and snippets.

@CodePint
Created June 12, 2018 10:56
Show Gist options
  • Save CodePint/bdfb6697fd1dc0e6ec7832860d0e3322 to your computer and use it in GitHub Desktop.
Save CodePint/bdfb6697fd1dc0e6ec7832860d0e3322 to your computer and use it in GitHub Desktop.
## finding the climb based on the route identifier
if params[:identifier].present?
routes = Route.search_identifier("%#{params[:identifier]}%")
route = routes.first.id if routes.present?
climbs = climbs.where(route_id: route)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment