Project

i_flash

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Rails Flash Internationalization Plugin
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

IFlash¶ ↑

Rails Flash Internationalization Plugin.

Easily sets flash messages in your controllers, reading from locale.yml files.

Install¶ ↑

gem install i_flash

Usage¶ ↑

In your controller:¶ ↑

i_flash :success
i_flash :failure
i_flash_auto :success
i_flash_auto :failure
i_flash_for some_condition?

In your locale file (en.yml)¶ ↑

en:
  actions:
    controller_name:
      action_name:
        success: "Action is successful!"
        failure: "Action failed!"

In your view (or layout)¶ ↑

= notice
= alert

Example¶ ↑

/app/controllers/posts_controller.rb:¶ ↑

def destroy
  @post = Post.where(params[:id]).first
  i_flash_for @post.delete
  redirect_to :back
end

/config/locales/en.yml:¶ ↑

en:
  actions:
    posts:
      destroy:
        success: "Post is deleted."
        failure: "Couldn't delete post."

Copyright¶ ↑

Copyright © 2010 [vladalive.com], released under the MIT license