add toastr for notifications
This commit is contained in:
parent
b46a721a7d
commit
5e3e482311
6 changed files with 44 additions and 7 deletions
|
|
@ -148,6 +148,17 @@ module ApplicationHelper
|
|||
end
|
||||
end
|
||||
|
||||
def toast_bootstrap_flash
|
||||
flash_messages = []
|
||||
flash.each do |type, message|
|
||||
type = 'success' if type == 'notice'
|
||||
type = 'error' if type == 'alert'
|
||||
text = "<script>toastr.#{type}('#{message}');</script>"
|
||||
flash_messages << text.html_safe if message
|
||||
end
|
||||
flash_messages.join("\n").html_safe
|
||||
end
|
||||
|
||||
def label_for(event_state)
|
||||
result = ''
|
||||
case event_state
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue