ruby-on-rails-5 - Rails .first(n),但在取 n 之前跳过“m”
问题描述
<% current_user.education_experiences.first(4).each_with_index do |exp, i| %>
我希望 .first(n) 可以变成 .first(8)、.drop_first(4) 或类似的东西
解决方案
推荐阅读
- jquery - 将 Icon 类插入到具有不同 ID 的每个 div
- web-component - 使用纤细的 Web 组件(自定义元素)的 outros$1 未定义错误
- c# - 在 Unity 中查找多边形内重叠多边形的可见区域
- javascript - InvalidCharacterError:无法在“文档”上执行“createElement”:提供的标签名称(“/static/media/tab1.fab25bc3.png”)不是有效名称
- php - 如何从准备语句 PHP 中收集结果?
- grails - grails restful groovy 无法解析符号
- ruby - Ruby GTK3 如何更改应用程序主题?
- python - 两个python代码找到第二低的分数
- reactjs - 从 React 组件的 componentDidMount 多次分派到 Redux 中的 thunk 的正确方法是什么?
- dialogflow-es - 允许 DialogFlow 对 web-service-fulfillment 的响应时间大于 5 秒