Forum: Ruby on Rails Does observe_field work in a partial

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7fbd0e99b27064b14793f028022974e5?d=identicon&s=25 Zhao Yi (youhaodeyi)
on 2009-01-01 03:12
I defined a partial and put an observe_field in this partial, but it
doesn't invoke the action when the field changed, this is the code:


<td>
  <%=select_tag 'project_version',
options_for_select(@project_versions)%>
  <%= observe_field :project_version, :update=>'view_name',
    :url=>{:action=>'update_view_name'},
    :with=>"'project_selection='+$('project_selection').getValue()+'&project_version='+encodeURIComponent(value)"%>

</td>
<td id="view_name"><%= render(:partial=>'view_name',:layout=>false)
%></td>
This topic is locked and can not be replied to.