> Can you send the code and error?
Sure. Here's the offending line:
session[:target_uri]='/admin' if !session.fetch(:target_uri,nil)
And here's the full controller code (See specifically line 10)
1 class LoginController < ApplicationController
2
3 def login()
4 # begin
5 if defined? params && params.has_key?('login')
6 record=Admin.find(:first,:conditions=>["Login=?",params
['login']])
7 if record && record.Password==params.fetch
('password','')
8 session[:user_id]=record.id
9 session[:login]=record.Login
10 session[:target_uri]='/admin' if !session.fetch
(:target_uri,nil)
11 uri=session[:target_uri]
12 session[:target_uri]=nil
13 redirect_to(uri) && return
14 else
15 session=nil
16 redirect_to(:action=>'index') && return
17 end
18 end
19 # rescue
20 # redirect_error($!)
21 # end
22 end
And finally, here's the error message:
NoMethodError in LoginController#login
undefined method `fetch' for #<CGI::Session:0xb6c036ac>
Thanks.
... doug
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---