You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: comments_controller.rb
    path of file: ./repos/linuxfr.org/app/controllers
    
    the code of the file until where you have to start completion: # encoding: UTF-8
class CommentsController < ApplicationController
  before_action :authenticate_account!, except: [:index, :show]
  before_action :find_node, except: [:templeet]
  before_action :find_comment, except: [:index, :new, :answer, :create, :templeet]

  def index
    @comments = @node.comments.published.order('id DESC')
    respond_to do |wants|
      wants.ht
    
  def create
    @comment = @node.comments.build
    enforce_create_permission(@comment)
    @comment.attributes = comment_params
    @comment.user = current_account.user
    @comment.default_score
    if !preview_mode && @comment.save
      flash[:notice] = "Votre commentaire a bien été posté"
      redirect_to url_for_content(@node.content) + "#comment-#{@comment.id}"
    else
      @comment.valid?
      render :new
    end