Guest User

Untitled

a guest
Jul 19th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. class CommentsController < .....
  2. inherit_resources
  3.  
  4. belongs_to :a, :b, :c, :d, :polymorphic => true
  5.  
  6. def create
  7. @comment = **parent**.comments.new(params[:comment])
  8. @comment.author = current_user
  9. create! do
  10. .........
  11. end
  12. end
  13. end
Add Comment
Please, Sign In to add comment