Skip to content

Instantly share code, notes, and snippets.

@ptagell
Created December 22, 2011 23:02
Show Gist options
  • Save ptagell/1512234 to your computer and use it in GitHub Desktop.
Save ptagell/1512234 to your computer and use it in GitHub Desktop.
Working code for update
def update
# @baby = Baby.find(params[:id])
if @baby.update_attributes(params[:baby])
if @baby.previous_changes[:notify]
redirect_to root_url, 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
@ptagell
Copy link
Author

ptagell commented Dec 22, 2011

I found that the baby definition at the start would do funny things because I'm using individual subdomains for each baby.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment