add documentation for each helper

This commit is contained in:
hitman 2017-03-07 01:42:33 +05:30 committed by Stella Rouzi
parent 5dece1ea48
commit a5d637fcf1
3 changed files with 11 additions and 12 deletions

View file

@ -1,4 +1,5 @@
module ApplicationHelper
# Including custom made helpers
include DateTimeHelper
include FormatHelper
include EventsHelper
@ -34,15 +35,6 @@ module ApplicationHelper
render 'shared/dynamic_association', association_name: association_name, title: title, f: form_builder, hint: options[:hint]
end
# Same as redirect_to(:back) if there is a valid HTTP referer, otherwise redirect_to()
def redirect_back_or_to(options = {}, response_status = {})
if request.env['HTTP_REFERER']
redirect_to :back
else
redirect_to options, response_status
end
end
def tracks(conference)
all = conference.program.tracks.map {|t| t.name}
first = all[0...-1]

View file

@ -1,9 +1,8 @@
module DateTimeHelper
##
<<<<<<< HEAD
# Includes functions related to date or time manipulations
##
=======
##
# Returns a string build from the start and end date of the given conference.
#
# If the conference is only one day long
@ -38,7 +37,6 @@ module DateTimeHelper
result
end
>>>>>>> refractor code into different files
##
# Gets an EventType object, and returns its length in timestamp format (HH:MM)
# ====Gets

View file

@ -30,4 +30,13 @@ module PathsHelper
return ''
end
end
# Same as redirect_to(:back) if there is a valid HTTP referer, otherwise redirect_to()
def redirect_back_or_to(options = {}, response_status = {})
if request.env['HTTP_REFERER']
redirect_to :back
else
redirect_to options, response_status
end
end
end