Rails Flash Internationalization Plugin.
Easily sets flash messages in your controllers, reading from locale.yml files.
gem install i_flash
i_flash :success i_flash :failure i_flash_auto :success i_flash_auto :failure i_flash_for some_condition?
en:
actions:
controller_name:
action_name:
success: "Action is successful!"
failure: "Action failed!"
= notice = alert
def destroy @post = Post.where(params[:id]).first i_flash_for @post.delete redirect_to :back end
en:
actions:
posts:
destroy:
success: "Post is deleted."
failure: "Couldn't delete post."
Copyright © 2010 [vladalive.com], released under the MIT license