N
N
nnobodyss abel2017-02-25 18:46:55
Blogs
nnobodyss abel, 2017-02-25 18:46:55

How to make flash success display?

help me figure out how to display a flash notification on a successful post update

onrails.club/t/ne-otobrazhaetsya-flash-animacziya-...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Karim Kyatlottyavi, 2017-02-25
@nnobodyss

...
redirect_to @post, :success => "Post was successfully updated"
...

As such, redirect_to only works with alert and notice . If you need exactly success , then wrap it in flash: { success: "Post was successfully updated" }.
It is also possible to assign a flash message as part of the redirection. There are two special accessors for the commonly used flash names alert and notice as well as a general purpose flash bucket
api.rubyonrails.org/classes/ActionController/Redir...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question