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 6134133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:19:02+00:00 2026-05-23T17:19:02+00:00

how to display error onto another page? I have a form under user folder

  • 0

how to display error onto another page?

I have a form under user folder

And in another place, my_account folder, i render the form from user folder inside the index page of my_account. so that i can reuse the form,to allow user to update their user information.

So when user click update, update method in UserController will be invoked.

My question is, if faild to update user object, how can i display error message on to my_account index page, and still have the field highlight, and error message??
e.g invalid format of email address

User
    -- new.html.erb
    -- _form

my_account
    -- index.html.erb

I tried to do following, but not sure how can i print the “error” in my_account page:

// try to update user information

// if failed, redirect to my account page
  format.html { redirect_to my_account_path, :error => @user.errors }
  • 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-23T17:19:03+00:00Added an answer on May 23, 2026 at 5:19 pm

    You need the errors to be set on the user object. This is used by form helper to display error messages when calling <%= f.error_messages %> inside your <% form_for %> block.

    The Rails best-practice is to call render here, not redirect, so that we ensure we pass the @user object that has errors properly assigned.

    To render the action, you can simply call:

     if !@user.save
       render :action => '../my_account/index'
     end
    

    This should easily solve your problem; just make sure to have all of your @member-variables set that the index.html.erb view expects.

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

Sidebar

Related Questions

I have a multi-lingual page where I want to display form validation error in
Under certain circumstances, I wish to display an error message to the user if
Why would IE 7 display HTTP Error Bad request 400 on the same page
I want to spawn another process to display an error message asynchronously while the
when i submit the form.. the form display the 'error' msg that mean the
I use carp free 3.6.4 to display content from some wordpress rss feeds onto
I have the below. The error class comes from here http://css.dzone.com/news/css-message-boxes-different-me I added display:
Many versions of Delphi including Delphi 2010 display Error executing 'D:\ProgramData{BBD31133-40F8-4B57-9BA6-DB76C03D153B}\Setup.exe': The parameter is
I'm using the ajax toolkit's ValidatorCalloutExtender to display error messages on a textbox. The
Struts - Alternative of <html:errors /> to display error messages in Jsp?

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.