Module: LinksHelper
- Defined in:
- app/helpers/links_helper.rb
Instance Method Summary collapse
- #link_to_bibliotheca_exercise(exercise) ⇒ Object
- #link_to_bibliotheca_guide(guide) ⇒ Object
- #link_to_error_404 ⇒ Object
- #link_to_issues(translation) ⇒ Object
- #link_to_path_element(element, options = {}) ⇒ Object
- #link_to_status_codes(code) ⇒ Object
- #mail_to_administrator ⇒ Object
- #url_for_application(app_name) ⇒ Object
Instance Method Details
#link_to_bibliotheca_exercise(exercise) ⇒ Object
29 30 31 |
# File 'app/helpers/links_helper.rb', line 29 def link_to_bibliotheca_exercise(exercise) edit_link_to_bibliotheca { "#{url_for_bibliotheca_guide(exercise.guide)}/exercises/#{exercise.bibliotheca_id}" } end |
#link_to_bibliotheca_guide(guide) ⇒ Object
25 26 27 |
# File 'app/helpers/links_helper.rb', line 25 def link_to_bibliotheca_guide(guide) edit_link_to_bibliotheca { url_for_bibliotheca_guide(guide) } end |
#link_to_error_404 ⇒ Object
8 9 10 |
# File 'app/helpers/links_helper.rb', line 8 def link_to_error_404 "<a href='https://es.wikipedia.org/wiki/Error_404'> #{I18n.t(:error_404)} </a>" end |
#link_to_issues(translation) ⇒ Object
12 13 14 |
# File 'app/helpers/links_helper.rb', line 12 def link_to_issues(translation) "<a href='https://github.com/mumuki/mumuki-laboratory/issues/new'> #{I18n.t(translation)} </a>" end |
#link_to_path_element(element, options = {}) ⇒ Object
3 4 5 6 |
# File 'app/helpers/links_helper.rb', line 3 def link_to_path_element(element, ={}) name = extract_name element, link_to name, element, end |
#link_to_status_codes(code) ⇒ Object
16 17 18 |
# File 'app/helpers/links_helper.rb', line 16 def link_to_status_codes(code) "<a href='https://es.wikipedia.org/wiki/Anexo:C%C3%B3digos_de_estado_HTTP'> #{I18n.t("error_#{code}")} </a>" end |
#mail_to_administrator ⇒ Object
33 34 35 36 37 38 |
# File 'app/helpers/links_helper.rb', line 33 def mail_to_administrator mail_to Organization.current.contact_email, Organization.current.contact_email, subject: I18n.t(:permissions), body: (current_user) end |
#url_for_application(app_name) ⇒ Object
20 21 22 23 |
# File 'app/helpers/links_helper.rb', line 20 def url_for_application(app_name) app = Mumukit::Platform.application_for(app_name) app.organic_url(Organization.current.name) end |