Skip to content

Instantly share code, notes, and snippets.

@craigw
Created July 20, 2009 19:08
Show Gist options
  • Save craigw/150520 to your computer and use it in GitHub Desktop.
Save craigw/150520 to your computer and use it in GitHub Desktop.
if @widget.save
flash[:info] = "Your widget has been saved."
flash[:notice] = "There are now #{Widget.count} widgets."
redirect_to @widget and return
else
flash.now[:warning] = "I couldn't save your widget."
render :action => "edit"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment