Can someone please help with this odd error? It appears that rails is not parsing the url correctly.
However, browsing to the url http://guruza.com/question/244/0.0/523#comment_537 does not replicate the error
A ActiveRecord::StatementInvalid occurred in question#index:
PGError: ERROR: invalid input syntax for integer: "523#comment_537"
: SELECT * FROM conversations WHERE (conversations."id" = '523#comment_537' ) LIMIT 1
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/abstract_adapter.rb:120:in `log'
-------------------------------
Request:
-------------------------------
* URL: http://guruza.com/question/244/0.0/523#comment_537
* Parameters: {"action"=>"index", "reward"=>"0.0", "conversation_id"=>"523#comment_537", "id"=>"244", "controller"=>"question"}
* Rails root: /var/www/guruza
-------------------------------
Session:
-------------------------------
* @write_lock: true
* @session_id: **HIDDEN**
* @new_session: false
* @data: {:request_data=>
{:request_uri=>"/question/244/0.0/523#comment_537", :raw_post=>nil},
"flash"=>{}}
-------------------------------
Environment:
-------------------------------
* DOCUMENT_ROOT : **HIDDEN**
* FCGI_ROLE : RESPONDER
* GATEWAY_INTERFACE : CGI/1.1
* HTTP_ACCEPT : text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
* HTTP_ACCEPT_CHARSET : ISO-8859-1,utf-8;q=0.7,*;q=0.7
* HTTP_ACCEPT_ENCODING: gzip
* HTTP_ACCEPT_LANGUAGE: es
* HTTP_COOKIE : **HIDDEN**
* HTTP_HOST : guruza.com
* HTTP_REFERER : http://guruza.com/
* HTTP_USER_AGENT : Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4
* HTTP_X_FORWARDED_FOR: 83.41.203.33
* HTTP_X_MOZ : prefetch
* PATH_INFO :
* QUERY_STRING :
* REDIRECT_STATUS : 200
* REDIRECT_URI : /dispatch.fcgi
* REMOTE_ADDR : **HIDDEN**
* REMOTE_PORT : 48682
* REQUEST_METHOD : GET
* REQUEST_URI : /question/244/0.0/523#comment_537
* SCRIPT_FILENAME : /var/www/guruza/public/dispatch.fcgi
* SCRIPT_NAME : /dispatch.fcgi
* SERVER_ADDR : 66.220.26.12
* SERVER_NAME : guruza.com
* SERVER_PORT : 80
* SERVER_PROTOCOL : HTTP/1.1
* SERVER_SOFTWARE : lighttpd/1.4.10
* Process: 15875
* Server :
-------------------------------
Backtrace:
-------------------------------
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/abstract_adapter.rb:120:in `log'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/postgresql_adapter.rb:148:in `execute'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/postgresql_adapter.rb:362:in `select'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/postgresql_adapter.rb:129:in `select_all'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:390:in `find_by_sql'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:924:in `find_every'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:918:in `find_initial'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:1103:in `method_missing'
[RAILS_ROOT]/app/controllers/question_controller.rb:21:in `index'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:910:in `perform_action'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:368:in `perform_action_with_filters'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in `perform_action_with_benchmark'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in `perform_action_with_benchmark'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/rescue.rb:82:in `perform_action_with_rescue'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:381:in `process'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:377:in `process_with_filters'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/session_management.rb:117:in `process_with_session_management_support'
/usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:38:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:150:in `process_request'
/usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:54:in `process!'
/usr/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/fcgi.rb:600:in `each_cgi'
/usr/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/fcgi.rb:597:in `each_cgi'
/usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:53:in `process!'
/usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:23:in `process!'
[RAILS_ROOT]/public/dispatch.fcgi:24
People succeed in answering Rich Collins's questions 37% of the time (32 successes in 86 attempts).
Answers by: Jake McArthur | Dave
Very odd. Seems like the anchor is being sent from client along with the rest of the URL, which, to my knowledge, is not supposed to happen. I'm not sure. Looks like either a bug in the client browser or in Rails itself. Possible workaround would be to manually parse out the anchor in the URL (the # and everything after it). Not the optimal solution, but seems to be the only one unless you feel like digging into Rails' code or just blaming the client.
Well I think it is happening very infrequenlty. No one has submitted a bug yet. I don't think it is worth looking into it further at this point. I was just hoping someone else had come across it.