Displaying 19 results from an estimated 19 matches for "doublerendererror".
2006 Dec 19
0
Looking for a way to avoid DoubleRenderError.
The "update" action of my controllers and under certain circumstances
creates a xml file on the filesystem.
Using an after_filter that only gets called after the update action I
create the XML file.
Problem is, I get a DoubleRenderError because the update action either
calls redirect_to or render. I can get around the render call by calling
performed?() but the call to redirect_to always chokes the rendering of
the xml file.
Any ideas on how I can achieve this behaviour ? Or is there a more
railish way to do the same thing ?
--...
2006 Apr 08
2
respond_to causes DoubleRenderError?
I have a custom authentication plugin that redirects users to a login
site if they aren''t already authenticated and their session hasn''t
timed out. I had things working fine with straight http requests, but
wanted to add support for ajax requests. I thought this would be a
simple matter of replacing all of my "redirect_to <blah> and return
false" calls with
2010 May 24
3
ActionController::DoubleRenderError
...n.friend_id
@myusers = User.find_by_id(@myfriend)
@myfriendlogin[i]=@myusers.login
puts @myfriendlogin[i]
i=i+1
respond_to do |format|
format.html { render :partial => ''users/dispfriends'', :locals =>
{:user => @myusers}}
end
end
end
Error:
ActionController::DoubleRenderError in UsersController#dispfriends
Can only render or redirect once per action
But, I need to display all the values in @myusers.
How can I pass the values?
Please help.
Thank you.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Gr...
2005 Jul 06
6
DoubleRenderError exception
The DoubleRenderError exception recently introduced is forcing me to go back and rewrite my apps authentication handler. Before I could do a redirect right in the middle of a request. Whatever was happening after that went unnoticed, I assumed it was simply ending the request after the redirect was called, but apparent...
2007 Nov 30
5
render_to_string in an after filter
...partial
that is sent to a web service. Here''s the code:
class MyController < ApplicationController
after_filter :post_to_webservice
def show
# show logic
end
def post_to_webservice
stuff = render_to_string :partial => ''stuff''
webservice_post(stuff)
end
I get a DoubleRenderError in the after filter. As I understand it,
the ''show'' action will be rendered, but won''t be sent to the browser
until the after filter is called. Because the ''show'' action is
already rendered (but not sent), we get a DoubleRenderError when
render_to_stri...
2006 Feb 13
1
Change redirect after method ''redirect_to''
...irect_to, is that possible?
My specific use case is that I want to change the default redirection of
"Login Engine" method signup, but I am seeing no other way then
copy/past and change the parameters of redirect_to.
This questions extends to render method as well, I want is to avoid
DoubleRenderError exception.
--
Posted via http://www.ruby-forum.com/.
2006 Dec 30
1
redirect_to(:action => ''foo'') and return
...ng, but if I do this in a controller
unless @variation && @variation.quantity > 0
flash[:error] = "Sorry, that product is currently not available."
redirect_to(:action => ''error'') and return
end
rspec tells me
2)
ActionController::DoubleRenderError in ''The Carts controller with an
existing User should add items to the cart''
Render and/or redirect were called multiple times in this action.
Please note that you may only call render OR redirect, and only once
per action. Also note that neither redirect nor render terminate
exec...
2006 Feb 20
3
Background work
...r
response before the method call terminated, that perhaps the render() /
redirect_to() was actually ther response being sent. I''m pretty sure the
this is wrong, that the method call termiantion signals the response to
client, but I got a very odd error when I tried it;
ActionController::DoubleRenderError (Can only render or redirect once per
action):
/vendor/rails/actionpack/lib/action_controller/base.rb:591:in
`render_with_no_layout''
/vendor/rails/actionpack/lib/action_controller/layout.rb:228:in
`render_without_benchmark''
/vendor/rails/actionpack/lib/action_controlle...
2010 May 03
7
rendering images dynamically
...end
In my query model, I have:
def load_images! &block
for(some_loop_that_gets_one_image_at_a_time) do
image = get_next_image
block.call(image)
end
end
In the _images.html.erb, I have:
<%=image_tag @image.url %>
The problem is that with this approach, I get a DoubleRenderError, and
I think this is because render is being called multiple times in the
block call within the loop.
What is the best way to get the effect I need (to load images one at a
time as they become available)?
Thanks
Anand
--
You received this message because you are subscribed to the Google Groups...
2010 Mar 21
3
Error in the code Doube Render (colins')
Hi everyone, i followed colins example and it worked perfectly but now i
get this error
ActionController::DoubleRenderError in UserController#login
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 redirec...
2006 Aug 03
5
DRYing up the view
...t; ''list'' on every iteration
to add some custom information for a particullar controller.
districts/_item.rhtml
...
<td><%= item.name %></td>
<td><%= item.region.name %></td>
...
As you may already guess I''m getting ActionController::DoubleRenderError
So is there better way of doing this, or maybe some other function
method such as: render_and_not_raise_DoubleRenderError exist? :)
Any ideas?
Someone proposed to use render_to_string, but it does not work in views.
Or creating an array with items in controller that will be used in
template to p...
2012 Sep 18
4
multiple modules defining same method included into a class
...s, looking
for a module named Rendering in the ActionController namespace, since
that is the namesapce that Base is defined in???
Well, ActionController module does define a module named Rendering:
module ActionController
module Rendering
def render(*args)
raise ::AbstractController::DoubleRenderError if response_body
super
self.content_type ||= Mime[lookup_context.rendered_format].to_s
response_body
end
So now the method render(*args) is included in the Base class as an
instance method. So when we call, for example, (hypothetically)
ActionView::Base.new.render :action =&...
2006 Mar 13
1
issue with redirect_to
...d the
redirect_to code, it seems the method does not use "target". here is the
source code of redirect_to from ActionController::Base
def redirect_to(options = {}, *parameters_for_method_reference) #:doc:
753: case options
754: when %r{^\w+://.*}
755: raise DoubleRenderError if performed?
756: logger.info("Redirected to #{options}") unless
logger.nil?
757: response.redirect(options)
758: response.redirected_to = options
759: @performed_redirect = true
760:
761: when String
762: redirect_to(...
2006 Feb 24
2
Double Render Error
Is there a way to suppress the Double Render Error:
"ActionController::DoubleRenderError.
Render and/or redirect were called multiple times in this action. Please
note that you may only call render OR redirect, and only once per
action."
Ideally, I would like the last redirect/render called to be the one that
is actually used when the page is sent to the browser.
--
Posted v...
2007 Aug 14
1
Upgrade to 1.0.8 broke Rake
...er place, with another signature...
http://pastie.caboo.se/87714
Which worked flawlessly prior the update.
This only brakes Rake (which actually is very helpful).
using script/spec and spec as gem to fire spec "testing" works almost
without problems (some issues with
ActionController::DoubleRenderError, nothing that couldn''t be fixed)
Any idea or suggestion? or I should stay at 0.9.8? :-)
Thanks
--
Luis Lavena
Multimedia systems
-
Leaders are made, they are not born. They are made by hard effort,
which is the price which all of us must pay to achieve any goal that
is worthwhile.
Vinc...
2010 Jun 26
0
erase_redirect_results in Rails 3.0
This method is non-existent in Rails 3.0. It is required for
responds_to_parent.
I try commenting it out but would get
AbstractController::DoubleRenderError
Thank you,
Sharkie
--
Posted via http://www.ruby-forum.com/.
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscrib...
2005 Aug 25
1
newbie questions about hosting address
...public.gmane.org
Message-ID: <430DE020.3020103-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Hi all,
I''m trying to follow the Rails book, and I''m the testing chapter.
I was trying to run the code in the page 149 and a DoubleRenderError
shows up at the ''get'' line in the following code:
def test_index
get :index
assert_response :success
end
I''ve read about DoubleRenderError, but they talk about
redirect_to, but not about get method. How can I solve this?
TIA,
Vamsee.
------------------------------...
2006 Sep 22
6
Using after_filter to control rendering on actions
...uccess_controller, :action =>
@success_action)
end
In my action, if I do nothing unusual, then I expect to render to the
regular place. If I override @success_controller and/or
@success_action, then my action code can set up the success target.
Unfortunately, when I try to do this, I get a DoubleRenderError, which I
am sure is because the default render is already done in my action
before I attempt to do either render in the after filter.
Can this be done, or do I have to resign myself to only _setting_ the
target in the after_filter, and then doing the rendering in the action
method itself?
Tha...
2005 Aug 08
68
Pluralized Controller Names?
If I do:
script/generate controller Photo
I get a controller named photo_controller. OTOH, if I do:
script/generate scaffold Photo
I get a controller named photos_controller. (Note that the controller
name is pluralized).
I realize that I''m specifying the controller name explicitly in the
first case, but it seems
odd to me that the scaffold command generates a pluralized