How does the proc in the caches_action if clause get execute
Posted
by Sid
on Stack Overflow
See other posts from Stack Overflow
or by Sid
Published on 2010-04-01T13:55:58Z
Indexed on
2010/04/02
12:13 UTC
Read the original article
Hit count: 273
I have a newbie kind of question which I cant get my head around. How does the Proc in the if condition of the caches_action get executed for the caches_action method.
for example caches_action :show, :if=>Proc.new{|x| something} what i dont get its how does this get called. I know i can execute a proc defined as
proc= Proc.new
by
proc.call
so i dont understand how this gets called. Second how do I pass conditions like
if logged_in?
I'd appreciate any help on this
© Stack Overflow or respective owner