Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

user_avatar_tag add timestamp option #639

Merged
merged 2 commits into from
May 12, 2016
Merged

user_avatar_tag add timestamp option #639

merged 2 commits into from
May 12, 2016

Conversation

songjiayang
Copy link
Contributor

@songjiayang songjiayang commented May 11, 2016

@codecov-io
Copy link

codecov-io commented May 11, 2016

Current coverage is 96.40%

Merging #639 into master will not change coverage

@@             master       #639   diff @@
==========================================
  Files           121        121          
  Lines          4717       4717          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits           4547       4547          
  Misses          170        170          
  Partials          0          0          

Powered by Codecov. Last updated by 983e944...aa6b7d6

image_tag(user.avatar.url(user_avatar_size_name_for_2x(size)), class: img_class)
image_url = user.avatar.url(user_avatar_size_name_for_2x(size))
image_url += "?t=#{user.updated_at.to_i}" if opts[:timestamp]
image_tag(image_url, class: img_class)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要测试

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@songjiayang
Copy link
Contributor Author

@huacnlee Added.

@huacnlee huacnlee merged commit 96ed279 into ruby-china:master May 12, 2016
@huacnlee
Copy link
Member

👍

@huacnlee
Copy link
Member

上线以后,实际测试,没有效果。

其实简单的处理方法可以 update 以后,在页面执行 location.reload()

@huobazi
Copy link
Contributor

huobazi commented May 12, 2016

update.js.erb

$.ajax({url: "current_user_avatar_url_with_timestamp", success: function(){Turbolinks.visit(location.href);}, cache: false});

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants