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

  • Home
  • SEARCH
  • 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 6674379
In Process

The Archive Base Latest Questions

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

Ok, the problem is trying to render a form from a controller to create

  • 0

Ok, the problem is trying to render a form from a controller to create a new entry.. For that im calling the default form that comes with the scaffold creation
I’m trying to make it like this:

<%= render :partial => 'contactos/form'  %> 

And im getting the following error

undefined method 'model_name' for NilClass:Class

Is there any way of just rendering from the view itself?

If there is not… Which parameters should I add to the controller?

Right now I just have following code:

Class DisplayController < ApplicationController
     def index
        @contactos = Contacto.all
     end
end

*This is the view controller, not the one with the create update and edit functions from my scaffold

Ok, I’ve done a very large research but no answer can fix my problem. (This is the first time I ask something, sorry in advance for any mistake I could make)

  • 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-26T03:44:19+00:00Added an answer on May 26, 2026 at 3:44 am

    The problem is that the variable your are using in the form for your contact doesn’t exist. The only variable you created in the index action is an array of all the contacts, but the form needs a single instance of a single contact.

    Because you are making a new contact, you have to do something like this in the action index:

    @contact = Contact.new
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I trying create a class derivated from System.Web.UI.Page and in override Render i set
I'm trying to create a form with quickform (default in the company). This form
I am trying to create form that contains another model in rails. I have
i am trying to do a simple form that adds a new comment using
Having a problem trying to create a function, as part of a BizTalk helper
I'm running into a problem trying to anchor a textbox to a form on
I have run into a problem trying to modify a form I myself have
I'm new to ASP.NET MVC and I'm trying to create a very simple blog
i've been trying to send data to the following form from my view. i
I'm trying to create a login and logout page with django. The problem I

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.