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 3660740
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:14:08+00:00 2026-05-19T01:14:08+00:00

Currently, my nested form (the one for address) isn’t showing up. It just shows

  • 0

Currently, my nested form (the one for address) isn’t showing up. It just shows the h1, and the submit button…

Relevant code:

class Address < ActiveRecord::Base
  belongs_to :user
  belongs_to :poll_option
  apply_addresslogic :fields => [[:number, :street], :city, [:state, :zip_code]]
end

class PollOption < ActiveRecord::Base
  belongs_to :poll
  has_one :address

  accepts_nested_attributes_for :address, :allow_destroy => true

end

<h1>Add a new address for voting</h1>

<% form_for @poll_option do |po_form| %>
  <%= po_form.error_messages %>

  <%= po_form.hidden_field :poll_id, :value => @poll.id %>

  <% po_form.fields_for :address do |addr_form| %>
      <%= addr_form.label :number %><br />
      <%= addr_form.text_field :number %><br />
      <br />
      <%= addr_form.label :street %><br />
      <%= addr_form.text_field :street %><br />
      <br />
      <%= addr_form.label :city %><br />
      <%= addr_form.text_field :city %><br />
      <br />
      <%= addr_form.label :state %><br />
      <%= addr_form.text_field :state %><br />
      <br />
      <%= addr_form.label :zip_code %><br />
      <%= addr_form.text_field :zip_code %><br />
      <br />
      <br />

  <% end %>

  <%= submit_tag "Create address and vote for this one" %>
<% end %>
  • 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-19T01:14:08+00:00Added an answer on May 19, 2026 at 1:14 am

    If you’re using Rails 3, you should be using <%= form_for .. and <%= f.fields_for ..., as the = on the tag indicates that it will output.

    Additionally, in your controller’s action that renders this form you need to be building the object (@poll_option.build_address or similar) so that the fields_for has an object to render.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a table with a nested table in it: <table class=datagrid id=report>
I have a nested form with the following models: class Incident < ActiveRecord::Base has_many
I am having trouble with my nested form. I am using Ryan Bates' code.
I am trying to set up a nested model form similar to the one
I have a nested model form that isn't functioning properly. The POST is to
Hi currently I have a nested XMl , having the following Structure : <?xml
I am currently asked to compare certain images with each other (using nested for
How would I create a nested list, I currently have this public function getNav($cat,$subcat){
I have about 200 categories that are nested. I am currently reading the documention
Currently in my code I have something in a for loop similar to: bstr

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.