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: editor_controller.rb
    path of file: ./repos/plots2/app/controllers
    
    the code of the file until where you have to start completion: class EditorC
    
  def legacy
    # /post/?i=http://myurl.com/image.jpg
    flash.now[:notice] = "This is the legacy editor. For the new rich editor, <a href='/editor'>click here</a>."
    flash.now[:warning] = "Deprecation notice: Legacy editor will be discontinued soon, please use rich/markdown editor."
    image if params[:i]
    template if params[:n] && !params[:body] # use another node body as a template
    if params[:tags]&.include?('question:')
      redirect_to "/questions/new?#{request.env['QUERY_STRING']}"
    else
      render template: 'editor/post'
    end