I have an @member object (e.g., @member=Member.find(5)) with which I
am doing the basic CRUD stuff. Records can be modified by either the
administrative user or by other users in their “profile” settings.
The two views are very similar but not identical. In an attempt to
keep my code DRY, I am trying to use a single view which gets shaped
into the proper form by a couple of parameters appended to the URL.
Without validation it all works perfectly.
Here’s the problem. With validation added, I need to render the view
in order to have error messages displayed. However, I need to use
redirect_to in order to pass the needed parameters in the URL. In
googling the issue, one commentator suggested saving the @member
object in either a flash or session variable. The idea sounded good;
but, it didn’t work. Virtually everything else that I read on google
seemed to say that one needs to use render in order to access the
error messages.
Under these circumstances, I’m concerned that I might be straying from
the beaten path by trying to pass values to the view in the URL. I’m
thinking that maybe Rails doesn’t want me to be doing that. Maybe
Rails wants me to somehow include those values in the @member object.
Anyway, my question is this: How should I be approaching this issue?
Thanks for any input.
... doug