Forum: Ruby on Rails Recent Upgrade to 2.1.0 not working IE7

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C4bfcc81ac9281cb905f38e97e4d4e0b?d=identicon&s=25 Shandy Nantz (snantz)
on 2008-10-07 19:20
I recently upgraded to Rails 2.1.0 and thought that everything worked -
I work mostly in FireFox and Crome - but when I went to do testing in
IE7, pretty much nothing works. I have my app broken down into about 10
seperate pages, all of which make use of auto_complete,
in_place_editors, and various rails helper (and I have added all the
appropriate plugins), I also have some before_filters in place for user
authentication. Has anyone had problems after upgrading where IE7 starts
throwing 500 errors, while every other browser works fine and how did
you fix it? Thanks,

-S
4c438a80fc30661ad619ea177cf9cbd0?d=identicon&s=25 Freddy Andersen (Guest)
on 2008-10-07 21:01
(Received via mailing list)
IE throwing 500 errors?!

What do you have in your rails log? Could you post a stack trace for
the 500 error you get.

Is this development or production env.
B14575f0ca69f10938fdd67e7156e0e1?d=identicon&s=25 Craig Demyanovich (Guest)
on 2008-10-08 06:25
(Received via mailing list)
Some time ago, I had a problem on my project with error 500 when using
IE
6/7. I think it was because I was doing $this instead of $(this) in some
JavaScript. I don't remember much more about the problem, though.

Regards,
Craig
C4bfcc81ac9281cb905f38e97e4d4e0b?d=identicon&s=25 Shandy Nantz (snantz)
on 2008-10-08 14:37
I'm not using $(this) anywehere, but what I did notice was that my
project isn't holding any session variables, and since I make heavey use
of those session variables I always get a use of a nil object error when
I shouldn't. Has something changed in rails 2.1.0. in regards to session
variables and how they are kept? Thanks,

-S
B14575f0ca69f10938fdd67e7156e0e1?d=identicon&s=25 Craig Demyanovich (Guest)
on 2008-10-08 14:44
(Received via mailing list)
Could you share a backtrace of one of the errors that you're seeing?

Craig
C4bfcc81ac9281cb905f38e97e4d4e0b?d=identicon&s=25 Shandy Nantz (snantz)
on 2008-10-08 15:30
This is the error I get:

Called id for nil, which would mistakenly be 4 -- if you really wanted
the id of nil, use object_id

app/controllers/enroll_controller.rb:125:in `check_authentication'
-e:4:in `load'
-e:4

I know what it means but the thing is is that it shouldn't be erroring
out. It is erroring out because it doesn't like this:

if @user.id != session[:user].id

It thinks that session[:user] is nil and it is, but the thing is is that
it shouldn't be. The check_authentication checks to see if a user that
is logged in is who they say they are. When they login the first thing
that happens is that a session gets started - session[:user] - then they
get redirected to the appropriate pages and the check_authentication
method gets called. I can see the session variable getting set but then
as we move further along in the process it disapears? And when I look in
my session folder under tmp it is empty which leads me to beleive that,
for whatever reason, the sessions are getting created just like they
should and then immediatly destroyed.

This is wasn't a problem a week ago, but last week I upgraded to rails
2.1.0. from 1.2.? and then this started happening. So I am kinda at a
loss as to what is happening and how to fix it. Thanks,

-S
B14575f0ca69f10938fdd67e7156e0e1?d=identicon&s=25 Craig Demyanovich (Guest)
on 2008-10-08 16:30
(Received via mailing list)
Out of curiosity, do you have a config.action_controller.session entry
in
config/environment.rb? It should look something like:

  config.action_controller.session = {
    :session_key => '_<your_app_name>_session',
    :secret      => '<some_long_alpha_numeric_string>'
  }

Also, in Rails 2.x, the default session store is cookies:

http://ryandaigle.com/articles/2007/2/21/what-s-ne...

Regards,
Craig
C4bfcc81ac9281cb905f38e97e4d4e0b?d=identicon&s=25 Shandy Nantz (snantz)
on 2008-10-08 16:58
Craig Demyanovich wrote:
> Out of curiosity, do you have a config.action_controller.session entry
> in
> config/environment.rb? It should look something like:
>
>   config.action_controller.session = {
>     :session_key => '_<your_app_name>_session',
>     :secret      => '<some_long_alpha_numeric_string>'
>   }
>
> Also, in Rails 2.x, the default session store is cookies:
>
> http://ryandaigle.com/articles/2007/2/21/what-s-ne...
>
> Regards,
> Craig

I do have that in my envirnments.rn, however, my session_key says:

=>_newen_session

and that isn't the name of my app. My app name is new_trunk[trunk],
should it be named something else?
B14575f0ca69f10938fdd67e7156e0e1?d=identicon&s=25 Craig Demyanovich (Guest)
on 2008-10-08 19:17
(Received via mailing list)
On Wed, Oct 8, 2008 at 10:58 AM, Shandy Nantz <
rails-mailing-list@andreas-s.net> wrote:

>
> I do have that in my envirnments.rn, however, my session_key says:
>
> =>_newen_session
>
> and that isn't the name of my app. My app name is new_trunk[trunk],
> should it be named something else?


I don't know if the session_key needs to match your app name. You could
change it to match and see what happens.

Craig
C4bfcc81ac9281cb905f38e97e4d4e0b?d=identicon&s=25 Shandy Nantz (snantz)
on 2008-10-08 19:42
Craig Demyanovich wrote:
>
>
> I don't know if the session_key needs to match your app name. You could
> change it to match and see what happens.
>
> Craig

I did change it and it seems to get me a little further. It now
recongizes that there is a session variable. The issue is that when I
set the session[:user] = @user, I print out the value when the session
gets set and it print ths correct value for an id, but when I try and
reprint it in a before_filter that I have it prints a completely
different value - not the same id. So I am not sure what is going on
now? I think the session issue has been taken care off, but something
else is definetly going on. Thanks again,

-S
C4bfcc81ac9281cb905f38e97e4d4e0b?d=identicon&s=25 Shandy Nantz (snantz)
on 2008-10-08 20:13
Nevermind, I don't think it's still saving any sessions. If I changed
the session name to session[:dude] I got the same ol' nil refernce which
says to me that it wasn't saved, although it does seem to recgonize
session[:user] which is a little strange. . .
This topic is locked and can not be replied to.