use render for toast and remove helper function
This commit is contained in:
parent
db1eedf51b
commit
33b9a2b93b
4 changed files with 20 additions and 33 deletions
|
|
@ -148,36 +148,6 @@ 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.options = {
|
||||
'closeButton': false,
|
||||
'debug': false,
|
||||
'newestOnTop': false,
|
||||
'progressBar': true,
|
||||
'positionClass': 'toast-bottom-center',
|
||||
'preventDuplicates': true,
|
||||
'onclick': null,
|
||||
'showDuration': '300',
|
||||
'hideDuration': '100',
|
||||
'timeOut': '5000',
|
||||
'extendedTimeOut': '1000',
|
||||
'showEasing': 'swing',
|
||||
'hideEasing': 'linear',
|
||||
'showMethod': 'fadeIn',
|
||||
'hideMethod': 'fadeOut'
|
||||
};
|
||||
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