Module: Recruiter::LinksHelper
- Defined in:
- app/helpers/recruiter/links_helper.rb
Instance Method Summary collapse
- #back_link(url = { action: :index }, options = {}, &block) ⇒ Object
- #button_link(url, classes = nil, options = {}, &block) ⇒ Object
- #cancel_link(url = { action: :index }, options = {}, &block) ⇒ Object
- #destroy_link(url, options = { }, &block) ⇒ Object
- #edit_link(url, options = {}, &block) ⇒ Object
- #new_link(url = {action: :new}, options = {}) ⇒ Object
- #show_link(url, options = {}, &block) ⇒ Object
- #submit_button ⇒ Object
Instance Method Details
#back_link(url = { action: :index }, options = {}, &block) ⇒ Object
42 43 44 45 46 |
# File 'app/helpers/recruiter/links_helper.rb', line 42 def back_link(url = { action: :index }, = {}, &block) (url, 'warning', ) do t('recruiter.links.back') end end |
#button_link(url, classes = nil, options = {}, &block) ⇒ Object
3 4 5 6 7 |
# File 'app/helpers/recruiter/links_helper.rb', line 3 def (url, classes = nil, = {}, &block) classes = [[:class], 'button', classes].compact .merge! class: classes link_to url, , &block end |
#cancel_link(url = { action: :index }, options = {}, &block) ⇒ Object
48 49 50 51 52 |
# File 'app/helpers/recruiter/links_helper.rb', line 48 def cancel_link(url = { action: :index }, = {}, &block) (url, 'alert', ) do t('recruiter.links.cancel') end end |
#destroy_link(url, options = { }, &block) ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'app/helpers/recruiter/links_helper.rb', line 24 def destroy_link(url, = { }, &block) .reverse_merge!({ method: :delete, data: { confirm: t('recruiter.messages.confirm_destroy')}, title: t('recruiter.links.destroy'), }) (url, 'alert tiny', ) do destroy_icon end end |
#edit_link(url, options = {}, &block) ⇒ Object
17 18 19 20 21 22 |
# File 'app/helpers/recruiter/links_helper.rb', line 17 def edit_link(url, = {}, &block) .reverse_merge!({ title: t('recruiter.links.edit') }) (url, 'warning tiny', ) do edit_icon end end |
#new_link(url = {action: :new}, options = {}) ⇒ Object
9 10 11 12 13 14 15 |
# File 'app/helpers/recruiter/links_helper.rb', line 9 def new_link(url = {action: :new}, = {}) .reverse_merge!({ title: t('recruiter.links.new') }) link_to(url, ) do [new_icon, t('recruiter.links.new')].join(" ").html_safe end end |
#show_link(url, options = {}, &block) ⇒ Object
35 36 37 38 39 40 |
# File 'app/helpers/recruiter/links_helper.rb', line 35 def show_link(url, = {}, &block) .reverse_merge!({ title: t('recruiter.links.show') }) (url, 'secondary tiny', ) do show_icon end end |
#submit_button ⇒ Object
54 55 56 57 |
# File 'app/helpers/recruiter/links_helper.rb', line 54 def action = params[:action] content_tag(:button, t("recruiter.submit.#{action}"), class: 'success') end |