Some question about 'observer_field'

Is the observe_field (ActionView::Helpers::PrototypeHelper )
can be apply to any html tag? (such as div)
I tried to apply ‘observe_field’ to observe the content of

tag, but, as the observed
's content was changed, there was nothing happend. for example (in test.rhtml): <%= link_to_remote "test", :update=>"content1", :url=> { :action=> "echo"} %>
content1
content2
<%= observe_field "content1", :update=>"content2" , :url=> { :action=>"echo2"} %>

** “echo1” and “echo2” do only rendering the text.

what i expect is that after i click ‘test’, ‘content1’ wil be changed,
and after that , ‘content2’ will be changed too, but what happends in
real
is only a change on ‘content1’.

did i do something wrong? anyone has comments?

Hi taiko,

taiko wrote:

Is the observe_field (ActionView::Helpers::PrototypeHelper )
can be apply to any html tag? (such as div)

observe_field can only be applied to form fields like text_field,
check_box,
etc.

hth,
Bill

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs