Skip to content

Instantly share code, notes, and snippets.

@kirkbushell
Created August 26, 2011 02:25
Show Gist options
  • Save kirkbushell/1172545 to your computer and use it in GitHub Desktop.
Save kirkbushell/1172545 to your computer and use it in GitHub Desktop.
# flash partial
- flash.each do |type,value|
- unless value.nil?
%div{:class => type.to_s}
%div
%span
= value
- unless object.nil?
%ul
- object.errors.full_messages.each do |msg|
%li
= msg
# when rendered from view
= render :partial => 'global/flash', :locals => {:flash => flash}
# and when a model is present
= render :partial => 'global/flash', :locals => {:flash => flash, :object => @model}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment