Ruby on Rails Wednesday, February 1, 2012

On 1 February 2012 03:45, Duane Morin <lists@ruby-forum.com> wrote:
> So I've inherited a legacy application and I'm trying to work around the
> edges as I put an admin tool interface on top of the existing code base.
> I install Devise for user authentication, since I've used it in the
> past.  I change none of the default code.  And yet, on successful sign
> in, I get an error:
>
> Render and/or redirect were called multiple times in this action. Please
> note that you may only call render OR redirect, and at most once per
> action. Also note that neither redirect nor render terminate execution
> of the action, so if you want to exit an action after redirecting, you
> need to do something like "redirect_to(...) and return".
>
> Here's the thing, look where that error was thrown
>
> vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_controller/metal/rendering.rb:15:in
> `render'
> vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_controller/metal/instrumentation.rb:40:in
> `block (2 levels) in render'
> vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/core_ext/benchmark.rb:5:in
> `block in ms'
> /Users/dmorin/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/benchmark.rb:295:in
> `realtime'
> vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/core_ext/benchmark.rb:5:in
> `ms'
> vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_controller/metal/instrumentation.rb:40:in
> `block in render'
> vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_controller/metal/instrumentation.rb:81:in
> `cleanup_view_runtime'
> vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/railties/controller_runtime.rb:24:in
> `cleanup_view_runtime'
> vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_controller/metal/instrumentation.rb:39:in
> `render'
> app/controllers/application_controller.rb:9:in `status'

What comes next in the trace? That should tell you where status is
being called from.
One thought, I wonder whether this status is overriding another one,
possibly in devise?

Also check in development.log (if you have not already done so) to
check what is happening before it fails.

Colin

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment