mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
add documentation for each helper
This commit is contained in:
parent
5dece1ea48
commit
a5d637fcf1
3 changed files with 11 additions and 12 deletions
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue