:locals does not pass var in rails 3.1.0 partial view

Here is code in form.html.erb for partial view. Local var :sid was
defined as the id of the record and it should be passed into the
partial view standards.html.erb as a local var.

  <% @rfq.standards.each do |r| %>
    <p><%= render :partial => 'standards', :locals => { :f =>

f, :sid => r.id } %>


<% end %>

Here is the standards partial view:

  <%= f.association :standards, :collection =>

Standard.active_std.all(:order => ‘name’), :label_method
=> :name, :value_method => :id, :prompt => “Choose std”, :label =>
“standard:”, :include_blank => true, :selected => sid %>

When standards rendered, there is an error saying that var or method
not defined. Any thoughts about the problem? thanks.

On 24 January 2012 03:20, emc_lab [email protected] wrote:

 <%= f.association :standards, :collection =>

Standard.active_std.all(:order => ‘name’), :label_method
=> :name, :value_method => :id, :prompt => “Choose std”, :label =>
“standard:”, :include_blank => true, :selected => sid %>

When standards rendered, there is an error saying that var or method
not defined. Any thoughts about the problem? thanks.

Can you show us the error please?

Colin

I have this same issue :confused:

It also helps to show the simplest possible case that triggers the
error.
Not only does it make things easier for people trying help you, you
often
find the error yourself in the course of simplifying.

On 11 April 2012 00:39, cj [email protected] wrote:

I have this same issue :confused:

Since the OP did not reply I assume he discovered a silly error. The
response to him applies to yourself, however, you must show the full
error message (copy/paste it here, do not retype in case of typo
errors) and post the relevant section of code where the error is
arising and the render call if it is a similar problem to the OP.

Colin

f, :sid => r.id } %>


not defined. Any thoughts about the problem? thanks.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


gplus.to/clanlaw