uninitialized constant ActionView::CompiledTemplates::Category

前端 未结 4 1256
面向向阳花
面向向阳花 2021-01-17 20:46

using this tutorial

http://railscasts.com/episodes/57-create-model-through-text-field

need to make it work in my app, was on rails 3.0.7 and it worked fine,

相关标签:
4条回答
  • 2021-01-17 21:07

    How the others suggested I had a similar problem solved be fix of wrong model name.

    0 讨论(0)
  • 2021-01-17 21:08

    I was using a PORO and it wasn't loading, giving me this error. It was because I had changed the class name without changing the file name.

    0 讨论(0)
  • 2021-01-17 21:18

    For me, i got the similar problem in the views. My Category model is available inside namespace example

    Module Financial
      class Category
      end
    end
    

    When i call simply Category.get_method. It was giving same error. so that i modified into Financial::Category that solved my problem.

    0 讨论(0)
  • 2021-01-17 21:29

    ok, just for others if they will get into this stupid things as I did, don't forget to have the category.rb in the app/models..

    class Category < ActiveRecord::Base
      ...
    end
    
    0 讨论(0)
提交回复
热议问题