Module: ActsAsWarnable::ApplicationHelper

Defined in:
app/helpers/acts_as_warnable/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#button_to_dismiss_warning(warning, options = {}) ⇒ Object



7
8
9
10
11
12
13
# File 'app/helpers/acts_as_warnable/application_helper.rb', line 7

def button_to_dismiss_warning(warning, options = {})
  form_for(warning, options) do |f|
    f.hidden_field(:dismisser_id, value: current_devise_user.id) +
      hidden_field_tag(:redirect_to, request.fullpath) +
      f.submit('Dismiss', class: 'btn btn-warning')
  end
end

#current_devise_userObject



3
4
5
# File 'app/helpers/acts_as_warnable/application_helper.rb', line 3

def current_devise_user
  send("current_#{Devise.mappings.values.first.name.to_s.underscore.singularize}")
end