Module: AgilideeDevise::ApplicationHelper
- Defined in:
- app/helpers/agilidee_devise/application_helper.rb
Instance Method Summary collapse
Instance Method Details
#bootstrap_devise_error_messages! ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/helpers/agilidee_devise/application_helper.rb', line 2 def return '' if resource.errors.empty? = resource.errors..map { |msg| content_tag(:li, msg) }.join sentence = I18n.t('errors.messages.not_saved', count: resource.errors.count, resource: resource.class.model_name.human.downcase) html = <<-HTML <div class="alert alert-danger alert-block alert-devise"> <button type="button" class="close" data-dismiss="alert">×</button> <h5>#{sentence}</h5> <ul>#{}</ul> </div> HTML html.html_safe end |
#devise_panel(title, &block) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/helpers/agilidee_devise/application_helper.rb', line 21 def devise_panel(title, &block) content_tag(:div, class: "panel panel-default panel-devise") do heading = content_tag(:div, class: "panel-heading") do content_tag(:h1, class: "panel-title") { title } end body = content_tag(:div, class: "panel-body", &block) heading + body end end |