Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # comments_controller
- def create
- @commentable = find_commentable
- @comment = @commentable.comments.build(params[:comment])
- if @comment.save
- redirect_to @comment.commentable
- else
- render :action => "show", :id => @commentable.id # <- how can i render the action for the right model, say post?
- end
- end
- # comments/form
- <% form_for [@commentable, Comment.new] do |f| %>
- <%= f.error_messages %>
- # error
- Template is missing
- Missing template comments/show.erb in view path /app/views:
Add Comment
Please, Sign In to add comment