This is possibly a newbie question, but I'm not sure what terms to search for.
Say I have a CUSTOMER object, and I want to send a MESSAGE to that customer.
What I would do first is add a SENDMESSAGE action on the CUSTOMER controller, which builds the message object. (Assume this is the right thing to do?)
In this instance however, rather than actually send the message from within this action, I need to forward to the edit view of the MESSAGE to capture the body text etc.
The question: I want to do this without persisting the object. I want to build the object here and then hand it over to another view for completion.
def sendmessage
@message = Message.new
@message.title = 'WIBBLE'
@message.thecustomer = self
@message.save
respond_to do |format|
format.html { redirect_to(edit_message_path(@ message)) }
format.xml { render :xml => @ message }
end
end
Maybe my question boils down to, what is the 'rails way' to cache parameters and objects across requests and multiple screens.
Happy to be pointed towards Web URLs as I expect this is simple.
Thanks