Hi Fred,

thanks for your advice!

Do you believe link_to_remote would be the solution here?

Luciano

On Mar 18, 2:28 pm, Frederick Cheung <[email protected]>
wrote:
> On Mar 18, 5:14 pm, Luciano <[email protected]> wrote:> Hello,
>
> > I have a simple link_to_function to add a group of form fiels, to use
> > observe_field I must have unique names...
>
> > I created a var to store the itens count but the partial is not
> > updating it's value.
>
> I think there's two things happening here. My understanding of the
> matter is that when a template is rendered it will get a copy of the
> controllers instance variables. Changes it makes to those instance
> won't persist though (the next template rendered will get a fresh copy
> of those instance variables).
>
> However I think you're actually falling down another whole: you're
> expecting each click on the add product link to re-evaluate the
> template. This cannot happen: link_to_function produces entirely
> client side javascript: your _quote_product.html.erb is only rendered
> once. If you look at the html source of your page you'll see than
> rendered html as a literal inside a blob of javascript.
>
> Fred
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to