Great :-)

Thanks for sharing! This group couldn't do without.

Regards
Michael

Am Mittwoch, 21. März 2012 07:51:46 UTC+1 schrieb Andrey Novikov:
>
> Fixed it!
>
> I found, that on click in recordselect field the is 
> RecordSelect.Abstract.open function is fired (from 
> https://github.com/scambra/recordselect/blob/master/app/assets/javascripts/jquery/record_select.js#L219),
>  
> that contains ajax call with success callback, but that callback doesn't 
> fire.
>
> I've put the next code into developer tools console:
>
> $.ajaxSetup({
>   error: function (XMLHttpRequest, textStatus, errorThrown) { 
> alert("Error!\n"+textStatus); }
> });
>
> And got a "parsererror" message.
>
> Server returns answer from browse?escape=false with text/javascript 
> mime-type and HTML-data. It caused jQuery to fail ajax-request with "parser 
> error" reason, but source ajax call from 
> jquery/record_select.js:222<https://github.com/scambra/recordselect/blob/master/app/assets/javascripts/jquery/record_select.js#L222>
>  haven't 
> an error callback to catch that situation.
>
> In my app assets javascripts I've found next code (added a long, long time 
> ago for now unknown reason):
>
> // makes Rails to know that jQuery Ajax requests should be processed as 
> .js format
> $.ajaxSetup({
>     'beforeSend': function(xhr) {xhr.setRequestHeader("Accept", 
> "text/javascript")}
> });
>
> After I've removed it and cleared the cache (dammit cache!) form is become 
> to appear (server now returns text/html).
>
> Thanks for attention. Sorry for my English :-)
>

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/activescaffold/-/75dY0KxRKMEJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.

Reply via email to