Displaying 20 results from an estimated 1100 matches similar to: "caching and admin area"
2009 Jul 09
0
Cache expiration with format not working as expected
Hi all,
In my OrdersController, I have two actions completed and incomplete
that respond_to HTML and CSV.
Im also action caching these actions
..
caches_action :completed, :incomplete
...
def completed
@orders = Order.completed
respond_to do |format|
format.html
format.csv {render :layout => false}
end
end
def incomplete
@orders = Order.incomplete
respond_to do
2012 Jan 25
0
Can't Get Caching to Work with Heroku and Memcache
I''m on Heroku and trying to implement caching in my Rails app, but I''m
running into some problems that I don''t understand. I thought it would be
easy after reading the Rails Guide and Heroku docs on caching strategies,
but apparently doing something wrong.
Issue 1: view of action doesn''t seem to expire Issue 2: when I use :layout
=> false, both my admin
2012 May 11
14
What is the point of using :format in routes?
Today I had a strange behavior that made me suspect of jQuery at first,
but then it happened that I''ve faced two gotchas, one from CoffeeScript
and one from Rails itself.
I have something like this:
routes.rb
post ''/fields/:id.:format'' => ''fields#show'', as: :field,
constraints: {id: /\d+/}
post ''/fields/remove/:id''
2006 Feb 21
0
observe_field custom event?
Is it at all possible to change the event that observe_field/
prototype watch for? In particular, is there any way to use an event
other than ''change'' for a textarea?
(Without hacking prototype, that is ;)
Thanks.
d.
--
Daniel Bogan
waferbaby : <http://waferbaby.com/>
waferboy : <http://waferboy.com/>
I make the Internets.
2006 Apr 10
3
can I expire a cached page using a regex?
I''m trying to expire all pages under my view action. These could
be /controller/view/1 or /controller/view/1/2
how can I expire all pages under /controller/view/? There must be a
way, but I''m stumped. Here''s my broken attempt. Thanks in advance for
any help,suggestions, or directions to a how to page.
expire_action(:controller =>
2006 Apr 08
2
trouble expiring cached pages
I''m having a bear of a time getting my cached pages to expire. Maybe
one of you guys can help me out. I''ll show my sweeper and then my log
to show that it "should" be working.
class PragmaticSweeper < ActionController::Caching::Sweeper
observe Comment
def after_save(comment)
expire_page(comment.post_id)
end
private
def expire_page(post_id)
2006 Jan 21
1
clearing/expiring the ''index'' action.
Hi all,
I''m having problems trying to expire the ''index'' action of a controller.
In short,
expire_action :action => ''index''
doesn''t work, but
expire_fragment (url_for :action =>
''index'').gsub(/\/index/,'''').split("://").last
works fine and deletes the cached page as expected.
I
2006 Feb 21
4
File_Column w/ Dynamic Sizing
I''m running file_column 0.3.1, and having a few problems... which are:
- Uploading a 378x567 jpg, and using :magick => {:geometry =>
"100x100" }, my image ends up being 67x100 ?
Is there a way to "force" the image to be the size you specify ?
- My view has a drop-down of sizes, and I''m trying to pass in this
size into :magick =>
2004 Aug 27
5
IAXy Power in Australia?
Does anyone know a place in Australia that sells a power supply
suitable for the IAXy? I haven't had any luck tracking one down.
--
jeremy bogan [ jeremy@segpub.com.au ]
segment publishing - design.develop.host
2006 Mar 12
0
Conditional Action Caching?
I have a system that requires login. This is for administrative
purposes, so the pages will be the same as the public ones, except they
will have the edit|delete|new options.
Right now, I have:
caches_action :index
which works great, but I''d like:
caches_action :index unless user?
where user?() is defined in application.rb.
I get an exception using this construct. Can anyone help?
2008 Sep 24
3
caches_page :if not executing (but caches_action :if) does
Hi folks -
Seeing a weird problem and would love some help. It''s documented in
http://pastie.org/278310 to be more readable.
In short, I have a
caches_page "action", :if => {stuff}
but the :if is never being called - the action is just caching every
time. (If I put a debugger call in the :if block, it never stops.)
If I replace caches_page with caches_action, the if
2007 Jan 22
2
caches_action :index for site root gets propagated to lower levels (how to stop?)
Hello all,
I am running a blog system which has its "/" (home page) cached like
this:
class ApplicationController < ActionController::Base
before_filter :index_cache_expirer, :only => [:index]
caches_action :index
so the site''s top page is caches for 60 seconds in my case
(index_cache_expirer is a home-made function to expire)
on the site, there is also a
2006 Aug 23
0
Caches_action/ before_filter problem .
Hello, I have a method called "check_permission" that is set to run as a
before_fitler and which checks if a user has the authorization to view a
page.
This page is displayed through the method "show" which is cached through
the tag "caches_action :show"
My problem is that once a user with authorization to a page accesses it,
then afterwards all users (with or
2007 Feb 03
1
How can I bypass caching for some users
I have action caching setup for several actions of an application but I
want the caching to only run for my administrators and have all other
users see non-cached pages. Is there a way to do this? Perhaps
something like passing a block to caches_action or setting some sort of
flag in my authentication method? If this is not possible with action
or fragment caching does anyone know of a
2005 Mar 24
3
Caching computation in rails?
Caching computation in rails?
Simple example: factorial modulus a large number
input: integer x
output: factorial( x ) % 12345678901234567
I want it so that if it computes factorial of N once, it will not have
to compute for N again.
code:
class SiteController < ApplicationController
caches_action :factorial, :inv
def examine
@inv = @params[''inv'']
@outv =
2006 Jun 28
7
caching objects
Hi,
i just wanted to say my sorries in advance (sorrie/sorry/sorri)...i have
just started learning about the subject of caching, but unfortunately
haven''t effictively managed to implement what i had learned.
obviously it''s possible to cache a whole page, or action with the
caches_page :x or caches_action :y methods, but for some reason it
hasn''t really worked with
2003 Aug 04
14
Mysql CDR
hello all,
I am using the msql cdr module to store cdr in db, I realised that it does't capture the start and end time af a particular call record.
Therefore I dive into the source code to add the start and end time into the query (add something like cdr->start, cdr->end), but end up getting segfault.
the original version of cdr_mysql.so works fine but I need the start time and end
2008 Jan 23
0
Action caching...
All,
I am running Merb 0.5.0. Is there a way to specify an expiration time on
an
action cache, besides physically calling expire_action ?
I have been looking at the code and I was not able to find support for
that
Something like
cache_action( :fred => 30*60, :blee => 60*60 )
would expire fred in 30 min and blee in 1 hour...
Any tips on how to achieve that ?
2004 Apr 12
2
TDM400P Issues
Hi,
I just got my TDM400P card (2 modules) and i installed it no probs. The
card is detected fine, but for some reason when I add the card to
zaptel.conf i get the following error:
--snip--
ZT_CHANCONFIG failed on channel 2: Invalid argument (22)
Did you forget that FXS interfaces are configured with FXO signalling
and that FXO interfaces use FXS signalling?
--snip--
My /etc/zaptel.conf looks
2004 Aug 19
2
IAX2 Port strangeness
For some unknown reason, two of my IAX peers started registering on
strange ports. Nothing has changed in the config, but they cannot make
calls to me, however I can still make calls to them. In my IAX2 peers,
the following is showing:
user1/user1 203.XXX.XXX.XXX (D) 255.255.255.255 4585 OK (21 ms)
user2/user2 203.XXX.XXX.XXX (D) 255.255.255.255 11280 OK (37 ms)
I've