when rendering a piece of my form after an Ajax call, I get the error

ActionView::Template::Error (undefined local variable or method `f'
for #<#<Class:....

controller
def change_price
new_price = ....
@tax_amount = new_price * I18n.t(:standard_tax_rate)
render 'backoffice/projects/change_price.js'
end

change_tax.js.erb
....
$('#project_tax').html( '<%= escape_javascript(render :partial =>
"backoffice/projects/project_tax", :locals => {:f => f}) %>');

and in my partial view

= f.text_field :tax_amount, :readonly => true, :precision =>
2, :delimiter => ".", :value => @tax_amount


is there a way to do it , or should I use simple text_field tag in
the partial ?

thanks for feedback

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedFeb 13, '12 at 5:21p
activeFeb 13, '12 at 5:21p
posts1
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

Erwin: 1 post

People

Translate

site design / logo © 2021 Grokbase