summaryrefslogtreecommitdiff
path: root/app/views/users
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-18 11:07:08 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-18 11:07:08 +0100
commitba4d32db18a7e6dd701dcfb210ec6af062ee2446 (patch)
tree54ee6ababb3c580a76181110a96d08186f2a3236 /app/views/users
parentdc3f3ef9eb0d0669d48be0795ecd601350ac978f (diff)
Added caching for users table.
Diffstat (limited to 'app/views/users')
-rw-r--r--app/views/users/_index_core.html.haml36
1 files changed, 19 insertions, 17 deletions
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