On Wed, Oct 29, 2008 at 11:48 PM, Jon Hancock <[EMAIL PROTECTED]> wrote:
>
> I have just started using the newer controller "message" hash. I had
> previously rolled my own flash behavior which worked well. Now, I'm
> trying to drop my old stuff along with an auth rewrite and getting
> some trouble.
>
> In older merbs, I used to have controller code like:
> ...
> flash[:notice] = "success!!"
> return redirect(url(:home))
> ...
>
> My old flash mechanism put this messages in the session cookie and it
> was there when the redirect got handled.
>
> The latest merb with merb-auth being used, I'm doing:
> ...
> message[:notice] = "success!!"
> return redirect(url(:home))
> ...
>
> and the message gets lost.
>
> I do see there is a new way to pass the message with the redirect, but
> this ends up putting the message in the URL, not what I want:
> return redirect(url(:home), :message => { :notice =>
> "success!!" })
>
> What are others using for this behavior??
>
> thanks, Jon
> http://shellshadow.com
Hi Jon,
This is how the helper works. It encodes it into the url on redirect.
You'd use it like this
redirect url(:some_url), :message => {:notice => "My Message"}
OR
message[:notice] = "My Message"
redirect url(:some_url), :message => message
If you don't want it in the url then you'll prolly want to go to something
like merb_has_flash
Cherrs
Daniel
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---