Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6038385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:12:43+00:00 2026-05-23T06:12:43+00:00

The update method is saving the data but the redirect is failing to render

  • 0

The update method is saving the data but the redirect is failing to render in the browser.

controller:

def update
  fbc = FbComments.find(params[:id])
  if fbc.update_attributes(params[:fb_comments])
    session[:report_for] = current_user
    redirect_to userhome_index_path
  end
end

console:

Rendered userhome/_feedback_receive_list.html.erb (2.2ms)
Rendered userhome/_applet.html.erb (1.2ms) ...
Rendered userhome/_feedback_give_list.html.erb (1.2ms)
Rendered userhome/index.rhtml within layouts/user_app (9.1ms)

As you can see, the console says the view is rendering including its partials, but in reality the browser remains on the page with the form. Same result in Safari, Firefox or Chrome. I seem to remember reading something about a Rails 3.0.8 issue not rendering a view on a redirect but i can’t remember where or why. I am still researching… anybody know where the problem is?

Thank you.

NOTES:

I updated my controller with dpb’s suggestion below. And then followed krohrbaugh and dpb’s comments below which got rid of the 406 error. The controller code above is updated with their recommendations.

Experimenting, i changed the redirect url to pre-rest format but the outcome was the same so i changed it back. The data is still updated, but the redirect is still not rendering.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T06:12:44+00:00Added an answer on May 23, 2026 at 6:12 am

    If you’re going to specify a format, you need a respond_to block. This should work:

    def update
      respond_to do |format|
        fbc = FbComments.find(params[:id])
        if fbc.update_attributes(params[:fb_comments])
          session[:report_for] = current_user
          format.html { redirect_to(root_path, :notice => 'Feedback was successfully updated.') }
        end
      end
    end
    

    Alternatively, if you only want to support html you can leave out the format.html all together like this:

    def update
      fbc = FbComments.find(params[:id])
      if fbc.update_attributes(params[:fb_comments])
        session[:report_for] = current_user
        redirect_to(root_path, :notice => 'Feedback was successfully updated.')
      end
    end
    

    You will probably also want to add an else statement just in case the update fails. Then you can handle it gracefully by redirecting or rendering another view.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a controller with an Index Method and a Update Method. After
In Ruby on Rails, I have an update method in a controller, that is
I've had problems with the update method in subsonic, so instead of using: a.Update()
I am having problems using the update method of scala.collection.immutable.HashMap.I don't see the reason
I am using jquery load method to update divs , it works great until
UPDATE: I tried implementing the method specified by Peter and am getting incorrect shadowing.
Update: Replaced the destructor example with a straight up method call example. Hi, If
[Update: I've found the API reference. The method used is below] <?php wp_delete_post( $postid,
Can the #save method be used to update a record? I know that I
I have a method that attempts to update a sql server database in an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.