Skip to content

alerts not working with redirect and return in controllers - Rails 7 #12

@ademir10

Description

@ademir10

Hello!
We're facing a problem after to implement Sweetify and Sweet_alert2 in a rails 7 Application, everything was working in rails 6 but it doesn't work only when we try to use alert messages with redirect like below for example:

def my_action
sweetalert_warning('Insira pelo menos 1 item!', 'Atenção', persistent: 'OK')
redirect_to purchase_path(@purchase) and return
end

but at same way if you try to use sweetalert messages without return as above everything is working as expected:
example:
def my_action
sweetalert_success('See you soon!', '')
redirect_to root_path
end

This is our configs:
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [arm64-darwin22]
Rails 7.1.3.4

rails-assets-sweetalert2 (5.1.1)
sweetalert2 (7.25.6)
sweetify (2.0.0)

any suggestion guys? thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions