Hi All,

     I want to refresh a partial onClick, onClick i am making ajax call
and getting the data but i am unable to refresh the partial. here is the
code

IN views: home.html.erb
$(document).ready(function() {
var currentCellText;
$(".inline").click(function() {
currentCellText = $(this).text();
$.ajax({
  type: 'GET',
  dataType: "json",
  url:'/test',
  async: false,
  data:{ foo1:currentCellText
        },
  dataType: "json",
  success:function(data){
        alert(data);
 $("ul#mymenu ul#mixed").html(data);
        },
error:function(data){
alert("Error");
}
});
});
});
<body>
<%= render(:partial => "partial", :object => @object) %>
</body>

contoller action

def some_action

          @object = Class.where(some_condition)
          render :home do |page|
                page["#myMenu #mixed"].replace_html :partial => "event"
:object=> @object
          end
end

partial _partial.html.erb

<ul id="myMenu" class="contextMenu">
        <ul id="mixed">
                <li><%="My Events"%>
                        <ul>
                                <li><span>
                                        <%@object.each do |k|%>
                                                <li><%=k%></li>
                                        <%end%>
                                </span></li>
                        </ul>
                </li>

</ul>


how can I refresh this partial onclick.

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to