0

Using juggernaut and redis in our application, which sends multiple request to our rails controller because of which double render error is thrown.

We have render :nothing => true in our rails controller.

Any idea to fix this exception?

We are using rails 2.3.

Controller Code:

def store_status
  @store = Store.find params[:id]
  @store.update_attributes(:stauts => 1)
  render :nothing => true
end

Edit:

Sorry the reason for this double render error is because some exception is raised after the call to render :nothing => true which is catched in my application controller. The rescue exception block contains another render so the double render error was raised. Any idea to find if there is already a render and then render in the rescue block?

7
  • 2
    Sending multiple requests should not throw a double render error, as each request should get it's own complete response. What does your action look like?
    – Alex Wayne
    Apr 22, 2013 at 6:55
  • In the action We just store some data in database and call render :nothing => true.
    – user001
    Apr 22, 2013 at 6:58
  • You're going to have to elaborate on that - there's not much to go on so far Apr 22, 2013 at 7:45
  • Can you show controller code?
    – Bob
    Apr 22, 2013 at 8:34
  • Updated the question with relevant code.
    – user001
    Apr 22, 2013 at 8:49

2 Answers 2

0

try return render :nothing => true

1
  • Sorry the reason for this double render error is because some exception is raised after the call to render :nothing => true which is catched in my application controller. The rescue exception block contains another render so the double render error was raised. Any idea to find if there is already a render and then render in the rescue block?
    – user001
    Apr 24, 2013 at 5:24
0

Sorry the reason for this double render error is because some exception is raised after the call to render :nothing => true which is catched in my application controller. The rescue exception block contains another render so the double render error was raised. Any idea to find if there is already a render and then render in the rescue block?

Solution:

use erase_results to clear your previous render or redirect before rendering in the resuce method

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.