v0.2 of Flash Helper Plugin

November 7th, 2005

Release 0.2 is now upon us. Release 0.1, described in Flash Helper Plugin – Flash Standardization was so broken as to be unusable. From bad requires, to invalid syntax and missing classes/modules, things looked pretty bleak.

Fortunately, things are better. Release 0.2 has no new features, but at least, it has the benefit of working.

Installation stays the same:

  • svn export http://opensvn.csie.org/flash_helper_plugin/tags/0.2 vendor/plugins/flash_helper
  • svn propset svn:externals vendor/plugins flash_helper http://opensvn.csie.org/flash_helper_plugin/tags/0.2 be very careful with this one
  • Download from RubyForge.org and unpack into vendor/plugins

Everyone, report any bugs and enjoy !

Over on the Rails mailing list, Luke Randall is proposing that Rails applications and generators standardize on some keys for the flash:

This being a very good idea, here is an excerpt of his proposition:

Based on my own experiences, I’d suggest something along the lines of the following (the names are the best I can think of, anyone is welcome to suggest better ones):
  • :notice for positive feedback (action successful, etc)
  • :message for neutral feedback (reminders, etc)
  • :warning for negative feedback (action unsuccessful, error encountered, etc)

(emphasis mine)

In the spirit of open source, I started coding a new Rails plugin: the FlashHelperPlugin. With it, you will be able to do:
1
2
3
4
5
6
7
8
9
class UsersController < ApplicationController
  def authenticate
    if authenticated? then
      flash_success('Authenticated successfully')
      redirect_back_or_default :controller => 'home'
    else
      flash_failure('Failed authentication')
    end
  end
1
2
3
4
5
6
7
8
9
10
<html>
<head>
  <%= stylesheet_link_tag 'scaffold', 'application',
      :media => 'all' %>
</head>
<body>
  <%= show_flash_messages %>
  <%= @content_for_layout %>
</body>
</html>

Actually, what I need now is a nudge to get the tests working. Also, WEBrick fails silently on startup with this plugin in vendor/plugins.

If you want to help, go on over to the flash_helper plugin project page for more information. Get started by checking out the code from Subversion.

 

Search

A picture of me

I am François Beausoleil, a Ruby on Rails coder. During the day, I work on XLsuite. At night, I am interested many things. Read my biography

Tags

(3) (1) (0) (2) (1) (1) (2) (2) (1) (2) (1) (2) (1) (2) (1) (1) (1) (1) (2) (14) (1) (1) (1) (1) (2) (1) (1) (2) (0) (1) (2) (1) (3) (1) (1) (1) (1) (1) (1) (0) (3) (2) (1) (2) (2) (1) (3) (2) (8) (8) (9) (12) (1) (1) (3) (1) (1) (1) (1) (1) (1) (2) (2) (2) (1) (1) (3) (1) (3) (1) (0) (23) (1) (1) (0) (1) (1) (1) (23) (25) (1) (1) (13) (1) (1) (2) (3) (1) (1) (4) (1) (2) (3) (0) (1) (7) (3) (1) (5) (5) (2) (2) (2) (4) (6) (7) (1) (0) (1) (1) (2) (2) (1) (4) (12) (2) (1) (2) (4) (1) (1) (1) (2) (8) (2) (3) (2) (2) (1) (3) (1) (1)

Links

Projects I work on

Categories

Archives