aboutsummaryrefslogtreecommitdiffstats
path: root/app/helpers/application_helper.rb
diff options
context:
space:
mode:
authorrhenium <rhenium@rhe.jp>2014-06-15 05:45:41 +0900
committerrhenium <rhenium@rhe.jp>2014-06-15 05:45:41 +0900
commitbfbcaa40bb2e3bc65a69aa71d5d4359a91086502 (patch)
tree99a0563e3aca0b8d9d07fb97b8cdd37c27792853 /app/helpers/application_helper.rb
parentb927c16d138c8fd8f670c91fb6b12489c3fb5d96 (diff)
downloadaclog-bfbcaa40bb2e3bc65a69aa71d5d4359a91086502.tar.gz
app: reorganize User#profile_image_url*
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r--app/helpers/application_helper.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 678a5d7..197b6d7 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -15,16 +15,10 @@ module ApplicationHelper
link_to name, options, html_options, &block
end
- def profile_image_tag(user, size = nil, options = {})
- if size
- url = user.__send__(:"profile_image_url_#{size}")
- else
- url = user.profile_image_url
- end
-
+ def profile_image_tag(user, size = :normal, options = {})
capture_haml do
haml_tag("img.twitter-icon",
- { src: url,
+ { src: user.profile_image_url(size),
alt: "@" + user.screen_name,
onerror: "this.src = '#{image_path("profile_image_missing.png")}'"
}.merge(options))