GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Sometimes you don't want cache to all user.
<%cache_if session[:user_id].blank?,'xxx' do%>
<%cache_unless current_user.admin?, 'xxx' do%>
Looks like you used a tab instead of spaces for the leading whitespace on lines 107-112. The indentation appears off.
Something like the following does respect much the rails standard?
<%cache_if current_user.admin?, xxx %>
<%cache_unless current_user.admin?, xxx %>
@acapilleri good idea
Add cache_if and cache_unless two methods to skip fragment cache.
This is a dup of #5396. Closing in favor of #5396
This is much simpler than the other solution.
Should this method be
cache_if !condition, name, options, &block