红宝石未初始化的常数

Ant*_*ony 0 ruby ruby-on-rails

我一直收到这个错误:

未初始化的常量GetxmlController :: Xmlparse

我的类代码看起来像

require "rexml/document"
include REXML

Class Xmlparse
  def parsetime
    xmlfile = File.new("colors.xml")
    xmldoc = Document.new(xmlfile)
    root = xmldoc.root
    return root
  end
end
Run Code Online (Sandbox Code Playgroud)

我的控制器看起来像:

class GetxmlController < ApplicationController
  def findxml
    @hxml=Xmlparse.new
    @test1=@hxml.parsetime
  end
end
Run Code Online (Sandbox Code Playgroud)

那么我在这里做错了什么?

Chu*_*uck 11

不要在Ruby中大写"Class".