Topic: Fancy flashes?

Can someone tell me if something like this is possible?

  def list
    @sites = Site.find(:all)
    if @sites.empty?
      flash[:notice] = 'No sites have been created yet!'
      render :update do |page|
        page.visual_effect :blind_down, 'flash-notice'
        page.delay(5) do
          page.visual_effect :dropout, 'flash-notice'
        end
      end
    end
  end

I know that render :update is used with remote scripting and that the above totally fails but... Any suggestions on getting something like this to work?

Re: Fancy flashes?

I think you're on the right track.  It should be more like this though:


 flash[:notice] = 'No sites have been created yet!'
render :update do |page|
  page[:flash-notice].hide
  page.replace_html :flash-notice, :partial => 'my_flash_partial'
  page.visual_effect :blind_down, 'flash-notice'
  page.delay(5) do
    page.visual_effect :dropout, 'flash-notice'
  end
end