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

  • Home
  • SEARCH
  • 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 8915207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:55:30+00:00 2026-06-15T04:55:30+00:00

I have a complex model, and want to create different screens for editing it.

  • 0

I have a complex model, and want to create different screens for editing it. As a silly example, say it’s a user model, and one screen lets you edit the name, another screen edits the phone number, and another page edits the user’s preferences.

It’s easy enough to create new actions, forms for each view, routes, and so on, but the trick is when you actually hit submit, it calls update, and … then what? If there are errors, it should go back to the page being used to edit the model, not the generic ‘edit’ view. Even on success, it might be nice to go back to the page that update was called from.

Hacking something up with the session would not be difficult at all, but I always wonder “is there a better way?”.

  • 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-06-15T04:55:31+00:00Added an answer on June 15, 2026 at 4:55 am

    I could not find a better way of doing it than this, and needed to do it in a hurry:

    def edit
      flash[:edit_user_return_to] = :edit
    ...
    
    def other_edit
      flash[:edit_user_return_to] = :other_edit
    ...
    

    followed by

    render(:action => flash[:edit_user_return_to] || :edit)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a fairly complex model for one of my pages; it's made of
I have a sort of plug-in model in which various complex user controls are
Let´s say I a have an User class and I want to return all
I have a fairly complex data model and consequently a fairly complex query (using
In my model I have three complex scopes returning the Discount object arrays. Each
I have complex GUI application written in Python and wxPython. I want it to
I have a complex form for a model Schedule that belongs to a parent
Am trying to simplify the create / edit view for a multi-model controller. User
I am using the standard User model (django.contrib.auth) which comes with Django. I have
I have class model for XML structure, where i want parse xml into it.

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.