Guest User

Untitled

a guest
Jun 18th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. # comments_controller
  2.  
  3. def create
  4. @commentable = find_commentable
  5. @comment = @commentable.comments.build(params[:comment])
  6.  
  7. if @comment.save
  8. redirect_to @comment.commentable
  9. else
  10. render :action => "show", :id => @commentable.id # <- how can i render the action for the right model, say post?
  11. end
  12. end
  13.  
  14. # comments/form
  15.  
  16. <% form_for [@commentable, Comment.new] do |f| %>
  17. <%= f.error_messages %>
  18.  
  19. # error
  20.  
  21. Template is missing
  22.  
  23. Missing template comments/show.erb in view path /app/views:
Add Comment
Please, Sign In to add comment