Hi,
I''m hoping there''s Rails developers who are working with
jquery mobile and
can help me out with this simple thing. I''m trying to update a div on a
page with an Ajax call and it doesn''t work. If I call jquery directly
from
the browser, the div gets updated. However, if I call it through a remote
call, the div remains unchanged. Here''s my code:
<div data-role="content">
<div class="content-primary">
<div class="mydiv">something</div>
<div><a href="#"
onclick="$(''.mydiv'').html(''hello'');">click</a></div>
<!-- this works -->
<div><%= link_to foobar_url, :remote => true, :method =>
:put,
''data-ajax'' => ''false'' do %>click<%
end %></div> <!-- this doesn''t-->
</div>
</div>
def foobar
respond_to do |format|
format.mobile { render :layout => false }
end
end
$(''.mydiv'').html(''world''); // in
foobar.mobile.erb
I don''t understand jquery that well, let alone jquery mobile. I tried
adding .page() and .trigger(''create'') like I''ve found
on some posts, but
that didn''t do anything. Also, I made sure that the cache tag was not
used.
TIA,
J
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/Jv03tnw5oq4J.
For more options, visit https://groups.google.com/groups/opt_out.
Hi, Can you post error your getting that will help you where exactly error is?. And Instead of link have you tried simple Ajax call like $.ajax() . -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/4IlrQCVYWKQJ. For more options, visit https://groups.google.com/groups/opt_out.
Thanks for replying. There is no error. The Ajax content is sent back to the browser but it doens''t get executed. What exactly is the simple Ajax call syntax? On Sunday, November 4, 2012 9:04:58 PM UTC-8, thil wrote:> > Hi, > > Can you post error your getting that will help you where exactly error > is?. > And Instead of link have you tried simple Ajax call like $.ajax() . > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/nRSmJAah4kgJ. For more options, visit https://groups.google.com/groups/opt_out.