Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

首页精华帖展示部分没有做字长限制 #658

Closed
Matrixbirds opened this issue May 18, 2016 · 4 comments
Closed

首页精华帖展示部分没有做字长限制 #658

Matrixbirds opened this issue May 18, 2016 · 4 comments

Comments

@Matrixbirds
Copy link
Contributor

image

@Matrixbirds
Copy link
Contributor Author

解决方案

app/views/topics/_topic.html.erb
  <%= link_to(truncate(topic.title, length: 40), topic_path(topic), title: topic.title) %>

@zlx
Copy link
Contributor

zlx commented May 20, 2016

这种方案在不同设备上显示会出现问题,最好是使用 CSS 来根据各平台确定宽度 https://github.com/twbs/bootstrap/blob/v4.0.0-alpha.2/dist/css/bootstrap.css#L5679-L5683

@huacnlee
Copy link
Member

是的,不应该靠裁剪来实现,应该用 CSS

@huacnlee
Copy link
Member

huacnlee commented Nov 4, 2016

🎉🎉🎉 解决老问题

Raincal pushed a commit to RubyHausu/ruby-china that referenced this issue Nov 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants