##updated

        def index
             case params[:listing_type]
                  when "all"
                        #the key here is teh same key I used for
memcached
                        if stale?(:etag => 'all_posts_key')
                         @posts = get_all_post_from_memcached
                         else
                          head :not_modified and return
                         end
                  when "most_popular"
                         if stale?(:etag => 'most_popular_key')
                         @posts = get_all_most_popular_from_memcached
                         else
                         head :notified and return
                        end
                  respond_to do |format|
                       format.html
                       format.js #for ajax reqeusts
                       format.xml #for rss etc
        end


update. I changed the original block a little and now  get a double
render error what am I doing wrong, should "head :notified and return"
just return the header and not touch the respond_to block?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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/rubyonrails-talk?hl=en.

Reply via email to