[Radiant] Redirect hell
Sean Cribbs
seancribbs at gmail.com
Fri Sep 1 12:06:04 CDT 2006
Thanks, John.
I guess I'll have to settle for not caching the page. I wanted to be able
to cache the page that displayed the comments (Commentable behavior), but
have it create the child page (CommentBucket behavior, whose children are
individual comments) if it doesn't exist, and then only cache when it
exists. Is there no way to clear the cache for that page after the redirect
occurs?
Alternatively, I'm thinking that I'm going to try redirecting to the
CommentBucket page (which already redirects back to the Commentable and is
uncached), and have it clear the cache before its redirect. Kind of a hack,
but it just might work.
Sean Cribbs
seancribbs.com
On 9/1/06, John W. Long <ng at johnwlong.com> wrote:
>
> Sean Cribbs wrote:
> > John et al,
> >
> > I think I'm in the final step of creating my Commentable/CommentBucket
> > behaviors before releasing them into the wild, but I've found that I'm
> > getting into an endless redirect loop after most of my process method
> > finishes (I want to potentially redirect back to the same page, but
> without
> > the post). How can I avoid this endless loop? I tried nullifying the
> > request and response objects. Is the redirect itself getting cached?
>
> You should definately turn caching off:
>
> def cache_page?
> false
> end
>
> When working with forms on pages, I like to use request.post? to check
> process a posted form. Here's and excerpt from a behavior I wrote for
> Ruby-Lang.org:
>
> def render_page
> if request.post?
> @list = List.lookup(params[:list] || 'ruby-talk')
> @first_name = get_param(:first_name)
> @last_name = get_param(:last_name)
> @email = get_param(:email)
> @action = get_param(:action).downcase
> ...
> @success = true
> else
> @success = false
> end
> super
> end
>
> --
> John Long
> http://wiseheartdesign.com
> _______________________________________________
> Radiant mailing list
> Radiant at lists.radiantcms.org
> http://lists.radiantcms.org/mailman/listinfo/radiant
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.radiantcms.org/pipermail/radiant/attachments/20060901/3c4ac80d/attachment.html
More information about the Radiant
mailing list