Skip to content

Instantly share code, notes, and snippets.

@dogweather
Created May 13, 2015 19:05
Show Gist options
  • Save dogweather/409432164dace3b1815d to your computer and use it in GitHub Desktop.
Save dogweather/409432164dace3b1815d to your computer and use it in GitHub Desktop.
businesses_controller#show
def show
map_query = CGI.escape("#{@business.name} #{@business.address} #{@business.city} #{STATE} #{@business.zipcode}")
@google_map_url = "https://www.google.com/maps/embed/v1/place?key=#{API_KEY}&q=#{map_query}"
@html_title = "#{@business.name} – health score #{@business.score}/100 – #{@business.city}, OR – Eaternet"
@html_description = "Health inspection history for the #{@business.name} at #{@business.address} in #{@business.city}, #{state}"
@inspection = @business.latest_inspection
@previous_inspections = @business.inspections.select { |i| i != @inspection }
@swiftype_meta_info = swiftype_metadata_json(@business)
expires_in(60.minutes, public: true)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment