redirect_to does not work unless call the to_s for the URL

2011-02-05 Thread Hu Kai
Hi all:

The application I wrote works fine on my local machine, after I
deployed, I found it always prompt the error:

NoMethodError (private method `gsub' called for #Hash:
0x2b4b9c6be1e0):
  app/controllers/words_controller.rb:19:in `

the corresponding line is

 format.html {redirect_to(user_path(@word.user))}

then I call the to_s

 format.html {redirect_to(user_path(@word.user).to_s)}

which fixed the problem.

Anyone knows why?

-- 
You received this message because you are subscribed to the Google Groups 
Heroku group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Logging - STDOUT ignores log_level

2011-02-05 Thread Jesse
just installed the logging addon
http://docs.heroku.com/logging

I am running a rails 2.2.2 app, maybe this occurs with other versions
as well

if you use
config.logger= Logger.new(STDOUT)

then you basically end up with debug output, request, sql, partials
rendered
seems like overkill for production?
- I did not notice any difference when adjusting the config.level ?
config.log_level = :info
the behavior was the same on both localhost and deployed to heroku

if you don't use the STDOUT, then you end up with no app logging, just
the nginx
2011-02-05T13:04:40-08:00 heroku[nginx]: GET /login?testing4 HTTP/1.1
| 10.116.147.148 | 3265 | https | 200

I like the standard rails :info level logging; for each request -
includes the parameters but not much else

Processing SessionsController#new (for 127.0.0.1 at 2011-02-05
13:07:30) [GET]
  Parameters: {action=new, testing5=nil,
controller=sessions}
Rendering template within layouts/application_full_width
Rendering sessions/new
Completed in 79ms (View: 18, DB: 6) | 200 OK [http://localhost/login?
testing5]

maybe this is an issue related to older versions of rails only?
has anyone else noticed this behavior or know of a workaround?

for now I am just removing the addon

Thanks,
- Jesse

-- 
You received this message because you are subscribed to the Google Groups 
Heroku group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: Logging - STDOUT ignores log_level

2011-02-05 Thread David Dollar
Hey there,

Try changing your log lines to this:

config.logger = Logger.new(STDOUT)
config.logger.level = Logger::INFO

Thanks,
David

On Feb 5, 2011, at 4:16 PM, Jesse wrote:

 just installed the logging addon
 http://docs.heroku.com/logging
 
 I am running a rails 2.2.2 app, maybe this occurs with other versions
 as well
 
 if you use
 config.logger= Logger.new(STDOUT)
 
 then you basically end up with debug output, request, sql, partials
 rendered
 seems like overkill for production?
 - I did not notice any difference when adjusting the config.level ?
 config.log_level = :info
 the behavior was the same on both localhost and deployed to heroku
 
 if you don't use the STDOUT, then you end up with no app logging, just
 the nginx
 2011-02-05T13:04:40-08:00 heroku[nginx]: GET /login?testing4 HTTP/1.1
 | 10.116.147.148 | 3265 | https | 200
 
 I like the standard rails :info level logging; for each request -
 includes the parameters but not much else
 
 Processing SessionsController#new (for 127.0.0.1 at 2011-02-05
 13:07:30) [GET]
  Parameters: {action=new, testing5=nil,
 controller=sessions}
 Rendering template within layouts/application_full_width
 Rendering sessions/new
 Completed in 79ms (View: 18, DB: 6) | 200 OK [http://localhost/login?
 testing5]
 
 maybe this is an issue related to older versions of rails only?
 has anyone else noticed this behavior or know of a workaround?
 
 for now I am just removing the addon
 
 Thanks,
 - Jesse
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Heroku group.
 To post to this group, send email to heroku@googlegroups.com.
 To unsubscribe from this group, send email to 
 heroku+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/heroku?hl=en.
 

-- 
You received this message because you are subscribed to the Google Groups 
Heroku group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: redirect_to does not work unless call the to_s for the URL

2011-02-05 Thread Keenan Brock
When I do a redirect I try to use user_url instead of user_path.

Since the browser only redirects to absolute urls, rails converts them. No use 
having rails generate a path only to have it convert it into a url.

No idea why it would not work thought.

--Keenan



On Feb 5, 2011, at 1:19 AM, Hu Kai iamka...@gmail.com wrote:

 Hi all:
 
 The application I wrote works fine on my local machine, after I
 deployed, I found it always prompt the error:
 
 NoMethodError (private method `gsub' called for #Hash:
 0x2b4b9c6be1e0):
  app/controllers/words_controller.rb:19:in `
 
 the corresponding line is
 
 format.html {redirect_to(user_path(@word.user))}
 
 then I call the to_s
 
 format.html {redirect_to(user_path(@word.user).to_s)}
 
 which fixed the problem.
 
 Anyone knows why?
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Heroku group.
 To post to this group, send email to heroku@googlegroups.com.
 To unsubscribe from this group, send email to 
 heroku+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/heroku?hl=en.
 

-- 
You received this message because you are subscribed to the Google Groups 
Heroku group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Gmail + Heroku outgoing email limits?

2011-02-05 Thread Alex
The Heroku Docs say that For limited email needs, Gmail can be a good
choice. You can send 200 messages a day. (http://docs.heroku.com/
smtp)

I am using Google Apps for your domain (non premium) and their docs
say: Each Google Apps account can currently send to 500 external
recipients per day. Google Apps for Business and Education users can
send to 2000 external recipients per day.

So does Heroku impose the limit of 200? Or are the docs incorrect?

-- 
You received this message because you are subscribed to the Google Groups 
Heroku group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: Gmail + Heroku outgoing email limits?

2011-02-05 Thread Ben Scofield
That sounds like a mistake in our docs, Alex - thanks for the catch!

Ben

On Feb 5, 2:11 pm, Alex nielsen...@gmail.com wrote:
 The Heroku Docs say that For limited email needs, Gmail can be a good
 choice. You can send 200 messages a day. (http://docs.heroku.com/
 smtp)

 I am using Google Apps for your domain (non premium) and their docs
 say: Each Google Apps account can currently send to 500 external
 recipients per day. Google Apps for Business and Education users can
 send to 2000 external recipients per day.

 So does Heroku impose the limit of 200? Or are the docs incorrect?

-- 
You received this message because you are subscribed to the Google Groups 
Heroku group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.