Displaying 20 results from an estimated 600 matches similar to: "Caching::Sweeper Access to Controller"
2008 Mar 06
3
cache_sweeper
Hi,
Why is cache_sweeper not a documented method? I was pretty sure it
used to be, but I could be wrong. I can''t seem to find any
information on it anymore in the online docs.
As a side note, looking at the code for cache_sweeper it appears to
only work with the :only option, not :except (ignores it)... what''s
the reason for this?
Thanks,
Andrew
2007 Feb 14
4
cache sweeper not getting called
Hi,
I''ve started to implement page caches but I''ve hit a brick wall getting
a sweeper to clear the cache when needed. It seems that any models that
I tell it to observe aren''t being observed properly. If I add the
sweeper to a controller the initialize method runs, but no matter what I
do the after_save/after_update callbacks aren''t running. Also if I try
to
2009 Aug 04
0
Authlogic::How to access current user from within a cache sweeper?
So I''m trying to follow along in Chad Fowler''s Rails Recipes (recipe
#59, Keeping track of who did what) and I simply want to access the
current user from within my cache sweeper. Normally you just
reference @current_user but that doesn''t seem to be the case here.
In Chad''s example, he calls controller.session[:user]. What''s the
Authlogic equivalent?
2005 Apr 25
1
Problems when using sweepers with postbacks
I''m using a cache sweeper class [1] to take care of some pretty complex
sweeping. However, there is a problem with the current implementation.
Namely, the sweeper gets called only when an action named in
cache_sweeper is called using GET. As many methods where sweeper would
be useful are using postback to send the form to the same action, this
causes the cache to get swept when
2006 Jan 31
2
Fragment caching and pagination
I''m just getting my hands dirty with caching. The pages I want to cache have
some user specific data on them (for example "log out"). That sent me down
the route of fragment caching. One of the things I want to pagination is a
paginated list. My question is how is pagination and query strings handled
with fragment caching? Does each page get its own fragment and query string
2006 Aug 01
8
Decoupled observers for controllers?
In the Rails Recipes book the recipe "Keeping track of who did what"
explains how to do decoupled observing of models.
In my application I''d like to do a similar thing but watching the
controllers. For example, when somebody hits the login method of the
Security controller, I''d like to make a note of it. In this case I
could observe the User model and watch for
2007 Sep 10
2
expire_page not working
I''ve enabled page caching on a site I''m currently constructing. The
sweeper is called upon any changes made to the model, as expected.
The sweeper code is as follows:
class PersonSweeper < ActionController::Caching::Sweeper
observe Person
def after_update(person)
expire_staff_page
end
def after_destroy(person)
expire_staff_page
end
def
2008 Jan 26
0
"value must be enumerable" exception when using a sweeper?
Folks,
I''m going slightly crazy here - I implemented a Sweeper in an older app
and used nearly the same exact code in my new app, yet I keep getting
this ''value must be enumerable'' exception. Even after I cut most of the
code away, I still get the error. If anyone can help, I would be much
obliged.
Notes: I''m using Engines... wonder if that could cause a
2010 Jan 25
1
ActionMailer does not find templates in production mode
Hello everyone,
I am currently struggling with the following issue that only seems to appear
in my production environment:
When attempting to send a mail from an ActionMailer the template location
algorithm does not seem to pick up the corresponding template:
ActionView::MissingTemplate (Missing template
event_mailer/approval_requested_notification.erb in view path app/views):
2008 Apr 01
1
"Undefined method merge" when using sweeper
Hi,
I''m trying to use sweepers for the first time and got a problem - I
get "undefined method `merge'' for "/signature/
f2d7c7c66450b169.html":String". The "/signature/f2d7c7c66450b169.html"
part of the error message is the cached page.
Here''s my sweeper:
class FooSweeper < ActionController::Caching::Sweeper
observe Foo
def
2005 Jun 26
4
calling controller and caching from a sweeper class
[cross-posting to rails and typo lists]
Hi,
I''m tinkering with the code for typo, a rails-based blog engine.
Typo has an XmlController with actions "rss" and "atom" which generate feed.xml
files, and it uses a caches_page declaration to cache the files that get
generated by those actions. It also has a Sweeper (Observer) class that expires
those cached files when a
2006 Sep 07
4
How to setup a sweeper to restart stale or hung mongrel servers
How do I setup a sweeper to restart stale or hung mongrel servers?
--
Jared Brown
jaredbrown at gmail.com
(765) 409-0875
7001 Central Ave
Indianapolis, IN 46220
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20060907/0994017f/attachment.html
2006 Jul 11
6
@record.each do |record|
I''m trying to ''destroy'' a particular record of a table
>From the controller side, i''ve found a list of possible records that i
want deleted.
ie. @chart = Chart.find(:all, :conditions => ["record_id = ?",
param[''id''] ]
''id'' is passed into the controller and @chart is all the possible
records that have
2010 Apr 16
1
Active Record observers broken: can't be used for "before" callbacks
I was just wondering what about a report that I made almost 2 months
ago: Active
Record observers
broken<https://rails.lighthouseapp.com/projects/8994/tickets/4087-activerecord-observers-cant-be-used-for-before-callbacks>
I think it''s a pretty big bug. In Rails 3, creating an observer with a
"before_save" callback (for instance) will result in all observed models
being
2006 Jan 03
5
Are cache sweepers used?
After drawing many virtual blank stares in the IRC channel and finding
zero results on the wiki for ''sweeper'' I''m left to wonder whether
these are actually officially supported, or are on their way toward
being deprecated. Is there a better way of expiring caches on model
saves and deletions?
Sincerely,
Tom Lieber
tom@alltom.com
http://AllTom.com/
2006 Jun 27
3
Easy question: Where do I put sweepers?
Trying to implement some sweepers to clean up my caching, but where do I
put them?
"ruby script/generate sweeeper" does nothing.
--
Posted via http://www.ruby-forum.com/.
2006 Jul 10
4
find()
Can some1 help me on syntax with the find() function.
I''m trying to pull up a table record, called chart, that has a
particular field specified.
ie
chart has a field called record_id, which i know. How can i find the
record that contains chart.record_id.
something like chart = Chart.find(:conditions => "record_id = :id")
this gives me an error. I''m passing
2006 Jul 12
3
Ajax, the Back button, and Sweepers
I''m working on an app that''s basically forms and that makes fairly heavy use of Ajax. As a result of the Ajax usage, if the visitor uses the back button they get the page as it was originally loaded, not as they left it. I''ve looked at the Sweeper documentation and can not tell for sure that it''ll do what I want, which is to force an unconditional reload from
2006 Mar 09
3
Runtime Error
Hi all,
Can anyone tell me why this line of code works in FF but not IE??
function stuff(id){
record_id=$(id);
record_id.innerHTML = "foo";
}
I get a ''Runtime Error''.
--
-----------------------
Iggy Sandejas
Web Developer
0419 485 252
D-Frag Solutions
http://www.dfrag.com.au
-----------------------
2007 Jul 26
1
Lohan the observable
Sorry, that name is a misnomer. However, I was excited to find that Ruby
has a built in Observable module and I''m pretty bored, so I apologize in
advance....
require ''observer''
# one who is observed
class Celebrity
include Observable
attr_accessor :name
attr_reader :is
def is=(val)
@is = val
changed
notify_observers(self)
end
end
# one who