2009/8/21 doug <[email protected]>:
>
> 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.

I suspect that you are making the whole thing more complex than it
needs be, as what you are saying does not make sense to me.  Is your
problem solved just by checking the profile of the current user in the
view erb file and showing the appropriate bits of the view based on
that?

Colin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to