I do see what works now and was surprised by the behavior. The
message gets encoded in the URL. I simply do not like this. I
understand that a cookie is limited in size and that some will have
cookies turned off; some have javascript turned off as well, we don't
want to create frameworks that work only for this too, do we?. I just
don't like having the message encoded in the URL, its ugly and screws
up bookmarking. I do not think this is a small issue or I wouldn't
bring it up.
I guess I'll have to go back to my own hand rolled flash behavior. To
do this along with using the new merb-auth behavior, I'll have to find
a hook for the cookie serialization and shove something in there.
I started getting traction with the new merb-auth behavior today. In
doing so, I threw out all my own hand rolled session behavior which
included my flash behavior. Now I get to figure out a way to recode
just the flash behavior that hooks into the cookie serialization.
thanks,
Jon
On Oct 30, 12:24 am, "Matt Aimonetti" <[EMAIL PROTECTED]> wrote:
> > I do not know why merb would add this new "message" thing without
> > ensuring the message lasted through a redirect; its pretty useless
> > without that behavior.
>
> doing:
> return redirect(url(:home), :message => { :notice => "success!!" })
>
> Works and is tested in the framework specs.
>
> You do need to access the object in your view tho.
>
> We don't consider the cookie option viable for many reasons (and I'm
> not the most qualified person to answer that). Mainly: people can have
> cookies being disabled, that forces you to use a session, you have the
> issues of double rendering. Look at how Rails does it and the
> Flash.now issues etc..and you will understand. Now, feel free to roll
> your own plugin to handle redirects using cookies, we'd be glad to
> assist you. (that's if you don't want to use merb_has_flash)
>
> -Matt
>
> On Wed, Oct 29, 2008 at 9:18 AM, Jon Hancock <[EMAIL PROTECTED]> wrote:
>
> > ok thanks...but that kind of sucks. If I wanted goofy URLs I'd use
> > seaside ;).
> > I really do not think that serializing the message in the cookie is
> > the path of "least surprise" developers expect.
> > I do not know why merb would add this new "message" thing without
> > ensuring the message lasted through a redirect; its pretty useless
> > without that behavior.
>
> > Jon
>
> > On Oct 29, 8:51 pm, "Daniel N" <[EMAIL PROTECTED]> wrote:
> >> 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
>
> On Wed, Oct 29, 2008 at 9:19 AM, Jon Hancock <[EMAIL PROTECTED]> wrote:
>
> > sorry, that reply should have said " I really _do_ think that
> > serializing the message in the cookie is the path of "least surprise"
> > developers expect."
>
> > seriously, putting the message in the URL is goofy.
>
> > On Oct 30, 12:18 am, Jon Hancock <[EMAIL PROTECTED]> wrote:
> >> ok thanks...but that kind of sucks. If I wanted goofy URLs I'd use
> >> seaside ;).
> >> I really do not think that serializing the message in the cookie is
> >> the path of "least surprise" developers expect.
> >> I do not know why merb would add this new "message" thing without
> >> ensuring the message lasted through a redirect; its pretty useless
> >> without that behavior.
>
> >> Jon
>
> >> On Oct 29, 8:51 pm, "Daniel N" <[EMAIL PROTECTED]> wrote:
>
> >> > 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
-~----------~----~----~----~------~----~------~--~---