Skip to content

Commit

Permalink
Update documentation in ApplicationHepler
Browse files Browse the repository at this point in the history
  • Loading branch information
bogardpd committed Apr 30, 2019
1 parent ceaf985 commit 5bf329d
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,13 @@ def tail_number_with_country_flag(tail_number, show_flag_without_country=true)

# GREAT CIRCLE MAPPER HELPER FUNCTIONS

# Return a region select menu, along with a map.
# Params:
# +map+:: The map to show
# +selected_region+:: The currently active region
# +anchor+:: If set, defines a page anchor position for the region select links to link to
# Create HTML for a map with region select tabs.
#
# @param map [Map] the map to show
# @param selected_region [Array] the currently active region as an array of
# ICAO prefixes (e.g. ["K","PH"])
# @option [String] :anchor (nil) a page anchor position for the region select links to link to
# @return [ActiveSupport::SafeBuffer] HTML for a map with region select tabs
def map_with_region_select(map, selected_region, anchor: nil)
return content_tag(:div, id: anchor) do
if map && map.exists?
Expand All @@ -127,9 +129,13 @@ def map_with_region_select(map, selected_region, anchor: nil)
end
end

# Return a menu allowing the user to switch between regions on a map
# Params:
# +region+:: The currently active region
# Create region select tabs.
#
# @param map [Map] the map to show
# @param selected_region [Array] the currently active region as an array of
# ICAO prefixes (e.g. ["K","PH"])
# @option [String] :anchor (nil) a page anchor position for the region select links to link to
# @return [ActiveSupport::SafeBuffer] HTML region select tabs
def gcmap_region_select_links(map, selected_region, anchor: nil)
region_hash = map.gcmap_regions(selected_region)
tabs = Array.new
Expand Down

0 comments on commit 5bf329d

Please sign in to comment.