Yes, you are right, I had to think of "redirect" as of exactly HTTP redirection, not a Ruby operation.
On Feb 20, 4:20 am, Matt Aimonetti <[email protected]> wrote: > You can call an action from a different action and pass whatever > attributes you want, but unless you serialize your object, you can't > pass your object via http redirection > > -matt > > Sent from my iPhone > > On Feb 19, 2009, at 17:09, Daniel Vartanov <[email protected]> > wrote: > > > > > Thank you, Mark, I thought about that. Certainly, it solves problem of > > passing errors or notices, but I lose benefits of *error_messages_for* > > and have to encode and decode hash information into string by myself. > > Of course, it is all possible, but I hope there is one 'nice' idiom > > for doing that. > > > On Feb 19, 10:52 am, MarkMT <[email protected]> wrote: > >> Are you sure you need to send the model to the redirect? If what > >> you're trying to do is display an error message in the Teams#show > >> view, I believe you can set 'message' in the Invitations#create > >> controller, as described here: > > >>http://wiki.merbivore.com/development/flash_messages > > >> Mark. > > >> On Feb 19, 1:09 am, Daniel Vartanov <[email protected]> > >> wrote: > > >>> To be specific, let's imagine we have two resources: Teams and > >>> Invitations (join-our-team invitations). > >>> Certainly, form for creating invitations is stored in Teams#show > >>> view, > >>> but it sends request to Invitations#create action. > > >>> The problem is: to show model validation errors (or any other action > >>> response) in the Teams#show view. Invitations#create action can only > >>> redirect to Teams#show, but not explicitly render it. So, how to > >>> pass > >>> the model @invitation (possibly with validation errors) back to > >>> Teams#show action? > > >>> Or the only way is to use AJAX in this case? > > >>> Thanks in advance. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "merb" 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/merb?hl=en -~----------~----~----~----~------~----~------~--~---
