title: Rails - undefined method `model_name' when calling edit
body: <p>I have a form to edit a page, while it tells it's not a variable from what I have known from related questions. In view, an error is raised from this line:</p>
  
  <pre><code>&lt;%= form_for @wiki, :url =&gt; giki_path(@wiki.name), :html =&gt; { :method =&gt; :put } do |f| %&gt;
  </code></pre>
  
  <p>Where the @wiki does seem to be an instance, which can be confirmed by:</p>
  
  <pre><code>$ rails console
  &gt; @wiki
   #&lt;Gollum::Page:70026260995800 Home (markdown) @wiki="path/to/git/wiki/.git"&gt;
  &gt; @wiki.name
  "/wiki/Home"
  </code></pre>
  
  <p>So I don't understand what is causing the problem:</p>
  
  <pre><code>undefined method `model_name' for #&lt;Gollum::Page:0x007f6084d2bdb0&gt;
  </code></pre>
  
  <p><strong>Edit</strong>:</p>
  
  <p>In controller:</p>
  
  <pre><code># giki_controller.rb
  def edit
    @wiki = Wiki.find(params[:id])
  end
  
  # the same method, worked fine
  def show
    @wiki = Wiki.find(params[:id])
  end
  </code></pre>
  
  <p>In model:</p>
  
  <pre><code># wiki.rb
  class Wiki 
    include ActiveModel::AttributeMethods
    include ActiveModel::Validations
    include ActiveModel::Conversion
    extend ActiveModel::Naming
  
    attr_accessor :name, :raw_data, :formatted_data, :title, :path, :change_desc, :versions
  
    # Gollum Init
    WIKI = Gollum::Wiki.new(Settings.wiki_repo, :base_path =&gt; "/wiki")
  
    # initialize
    def initialize(attributes = {})
      attributes.each do |key, value|
        send("#{key}=", value)
      end
    end
    # no database
    def persisted?
      false
    end
  
    def self.find(name)
      WIKI.page(name) # find a page by name
    end
  </code></pre>
  
  <p>First lines from logger:</p>
  
  <pre><code>NoMethodError - undefined method `model_name' for #&lt;Gollum::Page:0x007f607dfec4e8&gt;:
    actionpack (4.2.6) lib/action_controller/model_naming.rb:9:in `model_name_from_record_or_class'
    actionview (4.2.6) lib/action_view/record_identifier.rb:47:in `dom_class'
  </code></pre>
  
  <p><strong>Full traceback</strong>: I created a <a href="https://gist.github.com/KHN190/a8a9e8955334bbaddc9fd88f13f50823" rel="nofollow">gist</a>.</p>