Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
p193, listing 7.10, "private method `gsub' called for 5:Fixnum"
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Expand all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
jonbaty  
View profile  
 More options Aug 21 2007, 4:07 pm
From: jonbaty <jonb...@gmail.com>
Date: Tue, 21 Aug 2007 20:07:48 -0000
Local: Tues, Aug 21 2007 4:07 pm
Subject: p193, listing 7.10, "private method `gsub' called for 5:Fixnum"
Michael or Aure,
 I have been working through the book and I must say that it has been
very enjoyable. Most of the errors before I could find a fix, but I
have gotten to a point where I am stuck, . My code is ok until i add
the

cookies[:authorization_token] = {
            :value   => user.authorization_token,
            :expires => 10.years.from_now }

on page 193-194, listing 7.10. I am receiving the error below:

 NoMethodError in UserController#login
     private method `gsub' called for 5:Fixnum

I am using XP, MySQL, RadRails, and Firefox. Please let me know if you
need anymore info....I am also on RailsSpace, http://railsspace.com/profile/jbaty.
Again, thanks for a great book and hope to hear something soon.

Jonathan Baty


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
jonbaty  
View profile  
 More options Aug 21 2007, 6:12 pm
From: jonbaty <jonb...@gmail.com>
Date: Tue, 21 Aug 2007 22:12:29 -0000
Local: Tues, Aug 21 2007 6:12 pm
Subject: Re: p193, listing 7.10, "private method `gsub' called for 5:Fixnum"
I have found my issue, user.authorization_token is an integer and it
needed to be a string so to just put duck tape on it i added .to_s and
converted it to a string. I don't know if this is the correct way, but
it allows me to continue in the book. My code now is:

cookies[:authorization_token] = {
            :value   => user.authorization_token.to_s,
            :expires => 10.years.from_now }

Let me know if  I am on the right path..... Again, GREAT BOOK!!!!!
Thanks....jonathan

On Aug 21, 3:07 pm, jonbaty <jonb...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Aurelius Prochazka  
View profile  
 More options Aug 21 2007, 6:17 pm
From: "Aurelius Prochazka" <aure...@gmail.com>
Date: Tue, 21 Aug 2007 15:17:40 -0700
Local: Tues, Aug 21 2007 6:17 pm
Subject: Re: p193, listing 7.10, "private method `gsub' called for 5:Fixnum"

Perhaps someone else with experience on XP and Radrails can help - I don't
think we talk about gsub at all in the book, so I don't think this is an
error in our code.

On 8/21/07, jonbaty <jonb...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Aurelius Prochazka  
View profile  
 More options Aug 22 2007, 2:08 pm
From: "Aurelius Prochazka" <aure...@gmail.com>
Date: Wed, 22 Aug 2007 11:08:11 -0700
Local: Wed, Aug 22 2007 2:08 pm
Subject: Re: p193, listing 7.10, "private method `gsub' called for 5:Fixnum"

I got this from someone reading RailsSpace and I think it sheds some light
on the situation.

Aure

====

In the chapter 7 on page 195 Listing 7.11 you set the
following..

user.authorization_token = user.id

I know this is temporary because it gets switched
later and when you change it out for the
Digest::SHA1.hexdigest.. code it works fine but if one
tries the code before then you run into the error
below.

Apparently this has been addressed some what
http://dev.rubyonrails.org/ticket/7699 but the ticket
is for sqlserver and I am using mysql for this test.

If someone is using a version before 4-4-07 they may
have this issue. Just wanted to give you a heads up in
case people asked.

Thanks for the awesome book,
Brian

---------- Error Below Here ---------
NoMethodError in UserController#login
private method `gsub' called for 1:Fixnum

RAILS_ROOT:
E:/INSTAN~1/rails_apps/musthatedebt/config/..
Application Trace | Framework Trace | Full Trace
E:/INSTAN~1/ruby/lib/ruby/1.8/cgi.rb:342:in `escape'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/cgi_ext/cookie_ performance_fix.rb:79:in
`to_s'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/cgi_ext/cookie_ performance_fix.rb:79:in
`collect'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/cgi_ext/cookie_ performance_fix.rb:79:in
`to_s'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/cookies.rb:74:i n
`set_cookie'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/cookies.rb:61:i n
`[]='
#{RAILS_ROOT}/app/controllers/user_controller.rb:40:in
`login'
Request

Parameters: {"user"=>{"screen_name"=>"foobar",
"password"=>"password", "remember_me"=>"1"},
"commit"=>"Login!"}

Show session dump
Response
Headers: {"cookie"=>[["1"]], "Cache-Control"=>"no-cache"}

On 8/21/07, jonbaty <jonb...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google