Skip to content

Instantly share code, notes, and snippets.

@nitsujw
Created November 12, 2008 23:40

Revisions

  1. nitsujw revised this gist Nov 12, 2008. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,14 @@
    @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
  2. nitsujw created this gist Nov 12, 2008.
    5 changes: 5 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    def show(id)
    @post = Post.get(id)
    raise NotFound unless @post
    display @post
    end