I want to make a notification like this :
it is only a flash[:notice] with some CSS trick in RoR? or it there any other trick on this?
I want to make a notification like this :
it is only a flash[:notice] with some CSS trick in RoR? or it there any other trick on this?
It does not really have to do with RoR. If you only want the notice without animation, it's just some CSS. Else it requires Javascript, and is easily done with libraries like jQuery. But even without a library, this would not be very hard.
Yes, in Rails the way to handle this is by using the flash
and styling to suit.
You can use this jQuery plugin to simulate the effect. Just wrap the JS in a conditional which checks the flash (or session/db if you want a persistent message)
<% if flash[:notice] or session[:notice] or current_user.notifications %>
$(function () {
$.notifyBar({
html: "<%= flash[:notice] %>",
delay: 2000,
animationSpeed: "normal"
});
});
<% end %>
You will have to style it, obviously.