form_tag with remote=>true Error during failsafe response:

I am trying to find out why form_tag with remote => true is not sending an ajax response and only sending HTML. I have started a basic Rails App with two pages and am following the Railscast 205 UJS example. Every time I include:- <%= form_tag homepages_path, :method => 'get', remote => true do %> I get from the server(WEBrick):- (Ruby 1.9.2 and Rails 3) A 500 Internal server error Rendered homepages/index.html.erb within layouts/application (34.6ms) Completed in 52ms Error during failsafe response: incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string) Plus lots more cleaner calls. In my complicated application the above form_tag sends the search in UTF-8 Anyone has any ideas what is happening and how to solve the problem. As far as I know everything in the application is setup for UTF-8\ Thanks in advance.

Sometimes you make a fool of yourself as this time. Dumb and dumber I forgot the ":" from in front of the remote => Which gave the error. Hope this helps someone in future.

MDM <don.mapp@...> writes:

I am trying to find out why form_tag with remote => true is not sending an ajax response and only sending HTML. I have started a basic Rails App with two pages and am following the Railscast 205 UJS example. Every time I include:- <%= form_tag homepages_path, :method => 'get', remote => true do %> I get from the server(WEBrick):- (Ruby 1.9.2 and Rails 3) A 500 Internal server error Rendered homepages/index.html.erb within layouts/application (34.6ms) Completed in 52ms Error during failsafe response: incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string) Plus lots more cleaner calls. In my complicated application the above form_tag sends the search in UTF-8 Anyone has any ideas what is happening and how to solve the problem. As far as I know everything in the application is setup for UTF-8\ Thanks in advance.

This error was obtained because I left off the ":" off the remote=>true. I think, BUt after fixing that and getting the search working with html I am now still getting this error and I believe it has something to do with the returned values being in javascript.