binarylogic/authlogic — Issue #296: Passing @client_session in form gives "incompatible encoding regexp match"
Author: krokberg
Created: 2011-12-31 08:48:22+00:00
State: open

**client.rb**

```ruby
class Client < ActiveRecord::Base
acts_as_authentic
end
```

**client_sessions_controller.rb**

```ruby
class ClientSessionsController < ApplicationController
def new
@client_session = ClientSession.new

respond_to do |format|
format.html
format.xml { render :xml => @client_session }
end
end
...
```

**client_session.rb**

```ruby
class ClientSession < Authlogic::Session::Base

end
```

**new.html.erb**

```

<%= form_for(@client_session) do %>

<% end %>

```

**error**

```
Error during failsafe response: incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string)
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/backtrace_cleaner.rb:10:in `sub'
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/backtrace_cleaner.rb:10:in `block in initialize'
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/backtrace_cleaner.rb:77:in `call'
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/backtrace_cleaner.rb:77:in `block (2 levels) in filter'
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/backtrace_cleaner.rb:77:in `map'
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/backtrace_cleaner.rb:77:in `block in filter'
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/backtrace_cleaner.rb:76:in `each'
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/backtrace_cleaner.rb:76:in `filter'
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/backtrace_cleaner.rb:31:in `clean'
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.3/lib/action_dispatch/middleware/show_exceptions.rb:151:in `clean_backtrace'
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.3/lib/action_dispatch/middleware/show_exceptions.rb:138:in `application_trace'
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.3/lib/action_dispatch/middleware/show_exceptions.rb:132:in `block in log_error'
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/deprecation/reporting.rb:20:in `silence'
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.3/lib/action_dispatch/middleware/show_exceptions.rb:129:in `log_error'
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.3/lib/action_dispatch/middleware/show_exceptions.rb:64:in `render_exception'
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.3/lib/action_dispatch/middleware/show_exceptions.rb:59:in `call'
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/rack/logger.rb:13:in `call'
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.6/lib/rack/methodoverride.rb:24:in `call'
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.6/lib/rack/runtime.rb:17:in `call'
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.6/lib/rack/lock.rb:15:in `call'
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.3/lib/action_dispatch/middleware/static.rb:53:in `call'
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/engine.rb:456:in `call'
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.6/lib/rack/content_length.rb:14:in `call'
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/rack/log_tailer.rb:14:in `call'
/Users/jani/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.6/lib/rack/handler/webrick.rb:59:in `service'
/Users/jani/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/Users/jani/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/Users/jani/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
```

ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.0.0]
Rails 3.1.3
authlogic (3.1.0)

Error occurs when trying to access the "new"-page. Any ideas?