Skip to content

Instantly share code, notes, and snippets.

@kirkbushell
Created August 23, 2011 04:49
Show Gist options
  • Save kirkbushell/1164366 to your computer and use it in GitHub Desktop.
Save kirkbushell/1164366 to your computer and use it in GitHub Desktop.
# in controller method
@user = User.find_by_email(params[:email])
if @user.nil?
flash.now[:error] = 'No user found by that email address'
end
# view (in haml)
- unless flash.nil?
- if flash[:notice]
.notice
= flash[:notice]
- if flash[:error]
.error
= flash[:error]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment