Re: [Rails] js update partial missing template
On Thu, Jan 5, 2012 at 4:44 PM, Craig White <craig.white@ttiltd.com> wrote:
>
> On Jan 5, 2012, at 3:37 PM, Bill Walton wrote:
>
>> Hi Craig,
>>
>> On Thu, Jan 5, 2012 at 4:18 PM, Craig White <craig.white@ttiltd.com> wrote:
>>>
>>> <p>Missing template ... :formats=>[:html]}.
>>
>> That looks like a clue. Have you checked your request header?
> ----
> I think so... I've been staring at firebug and even copied the errors out of firebug and this looks like it wants to respond to html and not js and in fact, I enabled it to 'render :partial => "permissions"' and it clearly wants to respond with html and not js.
Then my best advice would be to double check the accepts header using
Live Http Headers. You may need to do some explicit setup prior to
the post.
Bill
> my js is a bit involved...
>
> $(function() {
> $("#priv_users").on("mouseenter", function() {
> !$("li:first", this).hasClass("ui-draggable") && $("li", this).draggable();
> });
> $("[id^=privileges-]").droppable({
> drop: function(event, ui) {
> $(this).addClass("ui-state-highlight");
> $.post("/permissions/add_member/", {
> "uid": ui.draggable.attr("data-add"),
> "id": $(this).attr("id")
> }, function(data) {
> var html = $(data);
> $("#messages1").replaceWith(html.closest("#messages1"));
> });
> }
> });
> })
>
> Craig
>
> --
> 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@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>
--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home