Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3391090
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:45:56+00:00 2026-05-18T03:45:56+00:00

this is probably a very basic question. I have installed rails 3 and generated

  • 0

this is probably a very basic question.

I have installed rails 3 and generated a project, after that i generated a model called post and a home index which routed root to. To get the latest posts listed on the home index page i moved the necessary methods from the posts controller to the index controller and also the necessary code into the index.html.erb file of home.

I have tried moving all the create and edit methods from the post controller and also the _form.html.erb from the post views to try and print the post form on my index page using render ‘form’.

But i get this error:

“undefined method `model_name’ for NilClass:Class”

How can i solve this problem? Grateful for all help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T03:45:57+00:00Added an answer on May 18, 2026 at 3:45 am

    Maybe the @post variable used by your form is not defined.
    If you have moved your form in your index, verify that in the index action, you create both the @post and the @posts variable like this :

    def index
      @post = Post.new
      @posts = Post.all
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This probably is a very very basic question but i can't seem to find
Probably a very basic beginner question. Imagine the following situation: I have an ASP.NET
This is a very basic question with probably an easy answer. Let's say I
I'm new to Python and have what is probably a very basic question about
I know this question is probably very basic, but I am a beginner so
This is probably a really simple jQuery question, but I couldn't answer it after
Okay, this is probably very simple but, I have the below checks (not at
Probably a very newb C++ question. Say I have a class, vertex, with several
This is probably very basic, but it's giving me a headache, and I'm not
As those who have worked on such a project you probably know this site:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.