From ba4d32db18a7e6dd701dcfb210ec6af062ee2446 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Fri, 18 Jan 2013 11:07:08 +0100 Subject: Added caching for users table. --- app/views/users/_index_core.html.haml | 36 ++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'app/views') diff --git a/app/views/users/_index_core.html.haml b/app/views/users/_index_core.html.haml index 51c15de..5d0fd16 100644 --- a/app/views/users/_index_core.html.haml +++ b/app/views/users/_index_core.html.haml @@ -1,18 +1,20 @@ -%table - %tr - %th - %th= t('users.index.user_name') - %th= t('users.index.email') - %th= t('users.index.first_name') - %th= t('users.index.last_name') +- cache(['user_table_row_inner_td', I18n.locale, current_user, users.order(:updated_at).last, users.count]) do + %table + %tr + %th + %th= t('users.index.user_name') + %th= t('users.index.email') + %th= t('users.index.first_name') + %th= t('users.index.last_name') - - reset_cycle - - for user in users - %tr{:class => cycle('odd', 'even')} - %td - = image_tag user.image_url(:mini).to_s if user.image_url(:mini) - %td= user.user_name - %td= user.email - %td= user.first_name - %td= user.last_name - =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => @tenant, :child => user} \ No newline at end of file + - reset_cycle + - for user in users + %tr{:class => cycle('odd', 'even')} + - cache(['user_table_row_inner_td', I18n.locale, current_user, user]) do + %td + = image_tag user.image_url(:mini).to_s if user.image_url(:mini) + %td= user.user_name + %td= user.email + %td= user.first_name + %td= user.last_name + =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => @tenant, :child => user} \ No newline at end of file -- cgit v1.2.3