Galera, unwittingly my girlfriend moved the folders of my project in Ruby on Rails and started to make that mistake. What can I do? It looks like he's not recognizing the Post as a class ...
Make sure that the Post
class is correctly set in the file app/models/post.rb
file of your application and if it is implemented similar to:
class Post
# código
end
Accidents do happen. One piece of advice I give you is to version your application code with a version control system such as Git ( link ). In this way, any accidental change or loss of code can be easily reversed.
You did not import your Post model inside the Controller, so it can not identify the class.
class PostController < ApplicationController
require 'models/post'
def index
@posts = Post.All
end
end