In remote_function how can i pass the className of the form element
i have the following code,
<%=link_to(content_tag('span',t('country.name')),'#',
   {:title=>t('country.name'),**:class=>"change_list"**,
    :onclick=>remote_function(:url => {:action => :change_view},
    :with =>"'**change**=**'+ ?????"**)}) %>
so, on onclick, i want to pass the parameter :change with the value o开发者_JAVA技巧f :class=>"change_list"
thanks,
If I am understanding correctly, that you want to pass the class name of the anchor tag in your Ajax request, then the following should work (re-formatted to try and improve readability):
<%= link_to(
      content_tag('span', t('country.name')), 
      '#',
      { :title   => t('country.name'),
        :class   => "change_list", 
        :onclick => remote_function(
        :url     => {:action => :change_view}, 
        :with    => "'change=' + this.className"
        )
      }) 
%>
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论