gitlab-org--gitlab-foss/app/helpers/snippets_helper.rb

21 lines
531 B
Ruby
Raw Normal View History

2011-10-16 21:07:10 +00:00
module SnippetsHelper
2011-10-27 07:11:42 +00:00
def lifetime_select_options
2011-10-27 06:46:21 +00:00
options = [
['forever', nil],
2011-10-27 07:11:42 +00:00
['1 day', "#{Date.current + 1.day}"],
['1 week', "#{Date.current + 1.week}"],
['1 month', "#{Date.current + 1.month}"]
2011-10-27 06:46:21 +00:00
]
options_for_select(options)
end
2013-06-05 19:25:27 +00:00
def reliable_snippet_path(snippet)
if snippet.project_id?
namespace_project_snippet_path(snippet.project.namespace,
snippet.project, snippet)
2013-06-05 19:25:27 +00:00
else
snippet_path(snippet)
end
end
2011-10-16 21:07:10 +00:00
end