My approach would be to first ensure the action does not throw an
error when visited directly (non-ajax) by any browser or bot.
In your ajax-only action:
redirect_to :controller => ''some_controller'', :action =>
''some_action''
unless request.xhr?
or possibly (?)
respond_to do |wants|
wants.html { redirect_to(...etc..) }
wants.js
end
You could then use robots.txt to encourage bots not to crawl that
link.
On Jul 15, 9:00 am, "Anthony Ettinger"
<ettin...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I''m using the autocomplete plugin for Rails, and have this code in
all
> pages (within <script> tags):
>
> var product_title_auto_completer = new
> Ajax.Autocompleter(''product_title'',
''product_title_auto_complete'',
> ''/store/auto_complete_for_product_title'', {})
>
> This line is generating errors with Googlebots. Apparently trying
> Googlebot is trying to crawl the url:
> ''/store/auto_complete_for_product_title'' which is defined
only in this
> ajax call.
>
> I''m assuming Googlebot is parsing the text and seeing the url
> (parameter) as a link to try, and results in a 500 error. Any ideas
> how I can refactor this out of this context so Googlebot won''t see
it?
>
> --
> Anthony Ettinger
> 408-656-2473http://anthony.ettinger.name
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---