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]