class Admin::CategoriesController < ApplicationController layout "admin" def index @category = Category.all end end I get an error
uninitialized constant Admin :: CategoriesController :: Category
How to fix it?
class Admin::CategoriesController < ApplicationController layout "admin" def index @category = Category.all end end I get an error
uninitialized constant Admin :: CategoriesController :: Category
How to fix it?
Create a Category model, obviously.
@Vladimir Gordeev So I did the table,
rails g model Category title:string description:text Got such a migration:
class CreateCatigories < ActiveRecord::Migration def change create_table :catigories do |t| t.string :title t.text :description t.timestamps end end end And this model:
class Catigory < ActiveRecord::Base end PS Everything is clear, incorrectly called the database, catigory instead of category.
Source: https://ru.stackoverflow.com/questions/375649/
All Articles