Skip to content

Instantly share code, notes, and snippets.

@nitsujw
Created November 12, 2008 23:40
Show Gist options
  • Save nitsujw/24313 to your computer and use it in GitHub Desktop.
Save nitsujw/24313 to your computer and use it in GitHub Desktop.
def show(id)
@post = Post.get(id)
raise NotFound unless @post
display @post
end
def create(comment)
@comment = Comment.new(comment)
if @comment.save
eager_cache([Posts, :show], :store => :action_store) { self.class.build_request(url(:post, @comment.post)) }
partial 'comments/comment', :comment => @comment
else
return "Error saving comment"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment