Guest User

Untitled

a guest
Feb 20th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. def create(comment)
  2. @comment = Comment.new(comment)
  3. if @comment.save
  4. @post = Comment.get(comment[:post_id])
  5. #eager_cache(:create, [Posts, :show], :store => :action_store) { build_request(build_url(:post, @post)) }
  6. eager_cache([Posts, :show], :store => :action_store) { build_request(build_url(:post, @post)) }
  7. partial "comments/comment", :comment => @comment
  8. else
  9. return "There was an error adding your comment"
  10. end
  11. end
  12.  
  13. merb : worker (port 4000) ~ Worker Thread Crashed with Exception:
  14. undefined method `build_url' for #<Comments:0xb74077b8> - (NoMethodError)
  15. /home/justin/merb/entitea_blog/app/controllers/comments.rb:32:in `create'
  16.  
  17. Or trying to update Post#show from Post#update
  18.  
  19. def update(id)
  20. @post = Post.get(id)
  21. @post.description = Whistler.white_list(post[:value])
  22. if @post.save
  23. eager_cache(:show, :store => :action_store) { build_request(build_url(:post, @post.to_param)) }
  24. redirect url(:post, @post.to_param)
  25. end
  26. end
  27.  
  28. merb : worker (port 4000) ~ Worker Thread Crashed with Exception:
  29. undefined method `build_url' for #<Posts:0xb71bac44> - (NoMethodError)
  30. /home/justin/merb/entitea_blog/app/controllers/posts.rb:159:in `update'
Add Comment
Please, Sign In to add comment