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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:51:53+00:00 2026-05-15T04:51:53+00:00

I’m trying to build a simple product backlog application to teach myself Rails. For

  • 0

I’m trying to build a simple product backlog application to teach myself Rails. For each product, there can be multiple product backlog entries, so I want to create a product view that shows the product information, all the backlog entries for the product, and includes a nested form for adding more backlog entries.

Everything works until I try to add the form to the view, which then results in the following error:

NoMethodError in Products#show

Showing app/views/products/show.html.erb where line #29 raised:

undefined method `pblog_ref' for #<Product:0x10423ba68>
Extracted source (around line #29):

26:   <%= f.error_messages %>
27:   <p>
28:     <%= f.label :pblog_ref %><br />
29:     <%= f.text_field :pblog_ref %>
30:   </p>
31:   <p>
32:     <%= f.label :product %><br />

The product view where the problem is reported is as follows (the partial works fine, so I won’t include that code):

<h1>Showing product</h1>

<p>
  <b>Product ref:</b>
  <%=h @product.product_ref %>
</p>
<p>
  <b>Description:</b>
  <%=h @product.description %>
</p>
<p>
  <b>Owner:</b>
  <%=h @product.owner %>
</p>
<p>
  <b>Status:</b>
  <%=h @product.status %>
</p>

<h2>Product backlog</h2>
<div id="product-backlog">
  <%= render :partial => @product.product_backlogs %>
</div>

<% form_for(@product, ProductBacklog.new) do |f| %>
  <%= f.error_messages %>
  <p>
    <%= f.label :pblog_ref %><br />
    <%= f.text_field :pblog_ref %>
  </p>
  <p>
    <%= f.label :product %><br />
    <%= f.text_field :product %>
  </p>
  <p>
    <%= f.label :description %><br />
    <%= f.text_field :description %>
  </p>
  <p>
    <%= f.label :owner %><br />
    <%= f.text_field :owner %>
  </p>
  <p>
    <%= f.label :status %><br />
    <%= f.text_field :status %>
  </p>
  <p>
    <%= f.submit 'Create' %>
  </p>
<% end %>

<%= link_to 'Edit', edit_product_path(@product) %> |
<%= link_to 'Back', products_path %>

This is the Product model:

class Product < ActiveRecord::Base
  validates_presence_of :product_ref, :description, :owner
  has_many :product_backlogs
end

This is the ProductBacklog model:

class ProductBacklog < ActiveRecord::Base
  belongs_to :product
end

These are the routes:

  map.resources :product_backlogs
  map.resources :products, :has_many => :product_backlogs

All the columns exist in the schema for this model:

create_table "product_backlogs", :force => true do |t|
  t.string   "pblog_ref"
  t.integer  "product_id"
  t.string   "description"
  t.string   "owner"
  t.string   "status"
  t.datetime "created_at"
  t.datetime "updated_at"
end

I’ve checked what I’m doing against the Creating a weblog in 15 minutes with Rails 2 screencast, and in principle I seem to be doing the same thing as him – only his nested comments form works, and mine doesn’t!

I hope someone can help with this, before I turn mad! I’m sure it’s something trivial.

  • 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-15T04:51:53+00:00Added an answer on May 15, 2026 at 4:51 am

    The solution was to replace the line:

    <% form_for(@product, ProductBacklog.new) do |f| %>
    

    with:

    <% form_for [@product, ProductBacklog.new] do |f| %>
    

    Note the space after form_for, and the square brackets.

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
We're building an app, our first using Rails 3, and we're having to build
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I am doing a simple coin flipping experiment for class that involves flipping a

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.