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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:51:34+00:00 2026-06-05T23:51:34+00:00

Using Ruby 1.8.6 & Rails 1.2. Models: Job , JobExtraStop : class JobExtraStop <

  • 0

Using Ruby 1.8.6 & Rails 1.2.

Models: Job, JobExtraStop:

class JobExtraStop < ActiveRecord::Base  
  belongs_to :job 
end 

class Job < ActiveRecord::Base 
  belongs_to :lead, :foreign_key => :id 
  has_one :quote, :foreign_key => :id 
  has_many :credit_card 
  has_many :job_extra_stops 
end 

Code from View:

Main View

<%= render_partial 'jobs/job_address_stop_fields', "stop" => stop, "index"=> index %>   

Partial that is called:

 <span class="jasf" id="lead_form_adrr_fields">

 <% fields_for "job_extra_stop[#{index}]", stop do |extra_stop_form| %>
<tr>
         <td><%= extra_stop_form.text_field :st_num, :size => 2%></td>
          <td><%= extra_stop_form.text_field :st_name,  :size => 15%></td>
          <td><%= extra_stop_form.text_field :apt_num,  :size => 2%></td>
          <td><%= extra_stop_form.text_field :city,  :size => 9%></td>
          <td><%= extra_stop_form.text_field :zip,  :size => 5%></td>
          <td><%= extra_stop_form.select(:state,( [[ "Select State", "" ]] + State::NAMES)) %>

          </td>
          <td><%= extra_stop_form.text_field :floor,  :size => 2%></td>
          <td>&nbsp;&nbsp;<%= extra_stop_form.text_field :elevator, :size => 1%></td>
          <td>&nbsp;&nbsp;<%= extra_stop_form.text_field :action_type,  :size => 5%></td>
          <td>&nbsp;&nbsp;<%= extra_stop_form.select(:location_type, ([["pick-up"],["drop-off"],["extra_stop"]] )) %></td>
          <td>&nbsp;&nbsp;<%= extra_stop_form.text_field :note,  :size => 10%></td>
          <td>^ / v</td>
          <td>&nbsp;&nbsp;<%= link_to_function "Remove", "$(this).up('.jasf').remove()" %></td>
</tr> 
<% end %> 
</span> 

Error:

Undefined Local Variable or method index

Don’t know what I am doing wrong.

  • 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-06-05T23:51:37+00:00Added an answer on June 5, 2026 at 11:51 pm

    You are not using the correct syntax for passing local variables to your partial, check here for the correct syntax http://api.rubyonrails.org/classes/ActionView/PartialRenderer.html

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

Sidebar

Related Questions

Models code: class Product < ActiveRecord::Base has_and_belongs_to_many :product_groups belongs_to :accessible_fields_group named_scope :sort_by_priority, :joins =>
our site is written using Ruby on Rails. We are using coffeescript & SCSS.
I am using ruby key & value fields to save a jquery function to
using Ruby on Rails 2.3.2, since I already created Scaffold for Story, so instead
Using Ruby 1.8.7-p358, Rails 3.0.12, gem responder, gem simple-form; jquery_ujs.js I have a form
I'm using Ruby on Rails to make an application where businesses can create accounts
I am using Ruby on Rails and I need to store a search result
New to RVM and playing with Rails 3 & Ruby 1.9.2 betas... I've got
I am using ruby 1.8.7 and rails 2.3.4 . I am developing a plugin
I'm getting the following error with my Ruby 1.9 & Rails 2.3.4. This happens

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.