Na początek witam wszystkich Bardzo proszę o pomoc, bo nie mogę sobie poradzić z tym problemem. Nie mam dużego doświadczenia z Railsami niestety. Po przesiadce z Ruby 1.8.6 na 1.9.1 mam sporo problemów.
Moja informacja o błędzie:
[code]Processing PagesController#about (for 195.189.88.11 at 2010-02-13 21:27:07) [GET]
NoMethodError (undefined method ^' for "1":String): app/controllers/pages_controller.rb:34:in
protect’
internal:prelude:8:in synchronize' thin (1.2.2) lib/thin/connection.rb:76:in
block in pre_process’
thin (1.2.2) lib/thin/connection.rb:74:in catch' thin (1.2.2) lib/thin/connection.rb:74:in
pre_process’
thin (1.2.2) lib/thin/connection.rb:57:in process' thin (1.2.2) lib/thin/connection.rb:42:in
receive_data’
eventmachine (0.12.8) lib/eventmachine.rb:242:in run_machine' eventmachine (0.12.8) lib/eventmachine.rb:242:in
run’
thin (1.2.2) lib/thin/backends/base.rb:57:in start' thin (1.2.2) lib/thin/server.rb:156:in
start’
thin (1.2.2) lib/thin/controllers/controller.rb:80:in start' thin (1.2.2) lib/thin/runner.rb:174:in
run_command’
thin (1.2.2) lib/thin/runner.rb:140:in run!' thin (1.2.2) bin/thin:6:in
<top (required)>’
/usr/lib/ruby/gems/1.9/bin/thin:19:in load' /usr/lib/ruby/gems/1.9/bin/thin:19:in
’
Rendering /home/wkrzyszt/www/myapp/public/500.html (500 Internal Server Error)[/code]
Mój kod:
[code]class PagesController < ApplicationController
layout “main”
before_filter :protect, :only => “about”
…
def protect
unless session[:user_id]
redirect_to login_path
return false
end
end
end[/code]
Wiem, że coś jest nie tak z session[:user_id], ale nie mam pojęcia co. Z góry dzięki za pomoc.