Re: Problems with link_to_remote

user splash
2008-01-24T05:18:07Z

Ryan Bigg wrote:
> link_to_remote does not support :position.
>
> Could you explain in more detail what you''re trying to do? Your
> descriptions
> are extremely vague and I cannot make sense of them.
>
> Can you show us the code of that page please?

Hi,

What I am trying to do is to create an link that adds a new label and
text field when i click it.


Example:

<% form_for :item, :url => { :action => :save_item}, :html => { :id
=>
"item" } do |n| %>



Item
0
<%= n.text_field :item
%> <%=
link_to_remote( "add", :update => "content", :url =>{
:action =>
:add_item }, :position => "bottom") %>





<%= link_to_function ''Previous'',
"$(''item'').submit()" -%>





<% end %>




After I click the link, "add", I will get the following result:

Item 0         text field
Item 1         text field           add(this is a link)
   .
   .
   .

When the link is being clicked, another label and text field will be
added to the table, the number beside "Item" will increment and the
link, "add" will be next to the new added row.

I am not sure how can I achieve that. I hope the above explaination is
clear enough. Can someone please help me ?

Thanks