Created
April 20, 2018 01:46
-
-
Save BerkhanBerkdemir/e7e826e373cafdc4987c073854012e4f to your computer and use it in GitHub Desktop.
Usage flash on Rails and Bootstrap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% flash.each do |message_type, message| %> | |
<div class="alert alert-<%= message_type %> alert-dismissible fade show" role="alert"> | |
<%= message %> | |
<button type="button" class="close" data-dismiss="alert" aria-label="Close"> | |
<span aria-hidden="true">×</span> | |
</button> | |
</div> | |
<% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PagesController < ApplicationController | |
def index | |
flash[:success] = 'You loged in' | |
redirect_to root_path | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment