Skip to content

Instantly share code, notes, and snippets.

@dnch
Forked from ptagell/babies_controller.rb
Created December 22, 2011 22:49
Show Gist options
  • Save dnch/1512199 to your computer and use it in GitHub Desktop.
Save dnch/1512199 to your computer and use it in GitHub Desktop.
Update controller
def update
if @baby.update_attributes(params[:baby])
if params[:notify] == true
flash[:notice] = "Done"
else
redirect_to(root_url(:host => with_subdomain(@baby.subdomain)), :notice => 'Your baby was successfully updated and everyone has been told the good news.')
end
else
render :action => "edit"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment