Module: Recruiter::LinksHelper

Defined in:
app/helpers/recruiter/links_helper.rb

Instance Method Summary collapse

Instance Method Details



42
43
44
45
46
# File 'app/helpers/recruiter/links_helper.rb', line 42

def back_link(url = { action: :index }, options = {}, &block)
  button_link(url, 'warning', options) do
    t('recruiter.links.back')
  end
end


3
4
5
6
7
# File 'app/helpers/recruiter/links_helper.rb', line 3

def button_link(url, classes = nil, options = {},  &block)
  classes = [options[:class], 'button', classes].compact
  options.merge! class: classes
  link_to url, options, &block
end


48
49
50
51
52
# File 'app/helpers/recruiter/links_helper.rb', line 48

def cancel_link(url = { action: :index }, options = {}, &block)
  button_link(url, 'alert', options) do
    t('recruiter.links.cancel')
  end
end


24
25
26
27
28
29
30
31
32
33
# File 'app/helpers/recruiter/links_helper.rb', line 24

def destroy_link(url, options = { }, &block)
  options.reverse_merge!({
    method: :delete,
    data: { confirm: t('recruiter.messages.confirm_destroy')},
    title: t('recruiter.links.destroy'),
  })
  button_link(url, 'alert tiny', options) do
    destroy_icon
  end
end


17
18
19
20
21
22
# File 'app/helpers/recruiter/links_helper.rb', line 17

def edit_link(url, options = {}, &block)
  options.reverse_merge!({ title: t('recruiter.links.edit') })
  button_link(url, 'warning tiny', options) do
    edit_icon
  end
end


9
10
11
12
13
14
15
# File 'app/helpers/recruiter/links_helper.rb', line 9

def new_link(url = {action: :new}, options = {})
  options.reverse_merge!({ title: t('recruiter.links.new') })

  link_to(url, options) do
    [new_icon, t('recruiter.links.new')].join(" ").html_safe
  end
end


35
36
37
38
39
40
# File 'app/helpers/recruiter/links_helper.rb', line 35

def show_link(url, options = {}, &block)
  options.reverse_merge!({ title: t('recruiter.links.show') })
  button_link(url, 'secondary tiny', options) do
    show_icon
  end
end

#submit_buttonObject



54
55
56
57
# File 'app/helpers/recruiter/links_helper.rb', line 54

def submit_button
  action = params[:action]
  (:button, t("recruiter.submit.#{action}"), class: 'success')
end