Skip to content

Instantly share code, notes, and snippets.

@collin
Created April 7, 2009 03:16
Show Gist options
  • Select an option

  • Save collin/91082 to your computer and use it in GitHub Desktop.

Select an option

Save collin/91082 to your computer and use it in GitHub Desktop.
class ContentsController < ApplicationController
def update id, content
@content = Content.get id
if @content.update_attributes_from_params_hash content
redirect content_url(@content, :action => :show), :message => {
:notice => "#{h(@content_type.name)} was successfully saved"}
else
message[:error] = "#{h(@content_type.name)} failed to be saved"
render :edit
end
end
end
"content" => {
"55" => "<p>Collin's company makes software that lets its users build their own web sites, without any programming.</p>",
"56" => "41.878003,-93.097702",
"46" => "",
"40" => "Collin's Company",
"51" => ""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment