Skip to content

Instantly share code, notes, and snippets.

@nitsujw
Created November 10, 2008 22:54
Show Gist options
  • Save nitsujw/23676 to your computer and use it in GitHub Desktop.
Save nitsujw/23676 to your computer and use it in GitHub Desktop.
def create(comment)
@comment = Comment.new(comment)
if @comment.save
@post = Comment.get(comment[:post_id])
#eager_cache(:create, [Posts, :show], :store => :action_store) { build_request(build_url(:post, @post)) }
eager_cache([Posts, :show], :store => :action_store) { build_request(build_url(:post, @post)) }
partial "comments/comment", :comment => @comment
else
return "There was an error adding your comment"
end
end
merb : worker (port 4000) ~ Worker Thread Crashed with Exception:
undefined method `build_url' for #<Comments:0xb74077b8> - (NoMethodError)
/home/justin/merb/entitea_blog/app/controllers/comments.rb:32:in `create'
Or trying to update Post#show from Post#update
def update(id)
@post = Post.get(id)
@post.description = Whistler.white_list(post[:value])
if @post.save
eager_cache(:show, :store => :action_store) { build_request(build_url(:post, @post.to_param)) }
redirect url(:post, @post.to_param)
end
end
merb : worker (port 4000) ~ Worker Thread Crashed with Exception:
undefined method `build_url' for #<Posts:0xb71bac44> - (NoMethodError)
/home/justin/merb/entitea_blog/app/controllers/posts.rb:159:in `update'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment