On 22.8.2006, at 13.37, Eduardo Yáñez Parareda wrote:

>
> Hi all, I'm using Rails 1.1.6. In a view I have:
>
>   <div id="formation_positions">
>     <%= render :partial => 'formation_players' %>
>   </div>
>   <%= link_to 'Reset', :action => :reset, :id => @formation %>
>
> also I have created a reset.rjs view with:
>
> page.replace_html 'formation_positions', :partial =>
> 'formation_players'
>
> but doesn't work fine, it doesn't replace 'formation_positions' div,
> instead it shows javascript code.
> I've tried page.replace instead of replace_html but I get the same
> result.
>
> How could I get the div replaced? Any ideas what am I doing wrong?

You need to use link_to_remote to make it an Ajax call. link_to  
creates just a normal anchor tag.

See http://api.rubyonrails.org/classes/ActionView/Helpers/ 
PrototypeHelper.html#M000412

Note also that you should *not* use the :update parameter in the  
link_to_remote call when you're using RJS templates. If you do, you  
will have same kinds of problems as now.

//jarkko

--
Jarkko Laine
http://jlaine.net
http://odesign.fi


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" 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-spinoffs
-~----------~----~----~----~------~----~------~--~---

Reply via email to