diff options
author | rhenium <rhenium@rhe.jp> | 2015-02-07 08:18:15 +0900 |
---|---|---|
committer | rhenium <rhenium@rhe.jp> | 2015-02-07 08:18:15 +0900 |
commit | 90d77ac45733c0916dd0c7a6c477589d6c79c82a (patch) | |
tree | 56cb607bf88abb671138ee9ff1580704706a8464 /app/helpers/application_helper.rb | |
parent | 368918a11d185f31879265a493773c9f7c20c25a (diff) | |
download | aclog-90d77ac45733c0916dd0c7a6c477589d6c79c82a.tar.gz |
web: lazy loading user stats (sidebar)
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r-- | app/helpers/application_helper.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ede2c51..9351c5a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -7,6 +7,21 @@ module ApplicationHelper end end + def register_view_part(name) + (@view_parts ||= []) << name + end + + def meta_info + { + controller: controller.controller_path, + action: controller.action_name, + parts: @view_parts.try(:join, " "), + user_id: @user.try(:id), + user_screen_name: @user.try(:screen_name), + tweet_id: @tweet.try(:id) + } + end + def link_to_with_active(name, options = {}, html_options = {}, &block) if current_page?(options) html_options[:class] = (html_options[:class].to_s + " active").strip |