我在项目根目录中创建了一个bower.json文件,但是当我运行时:
$ bower install
Run Code Online (Sandbox Code Playgroud)
我得到以下输出:
bower not-cached https://github.com/mirceasinteanu/nanoScrollerJS.git#master
bower resolve https://github.com/mirceasinteanu/nanoScrollerJS.git#master
bower not-cached http://jamesallardice.github.io/Placeholders.js#*
bower resolve http://jamesallardice.github.io/Placeholders.js#*
bower download http://jamesallardice.github.io/Placeholders.js
bower cached http://github.com/davatron5000/FitVids.js.git#1.1.0
bower validate 1.1.0 against http://github.com/davatron5000/FitVids.js.git#*
bower cached git://github.com/jquery/jquery.git#1.10.2
bower validate 1.10.2 against git://github.com/jquery/jquery.git#~1.10.0
bower cached git://github.com/gfranko/jquery.selectBoxIt.js.git#3.8.1
bower validate 3.8.1 against git://github.com/gfranko/jquery.selectBoxIt.js.git#*
bower cached git://github.com/chrisabrams/commonjs.git#0.2.0
bower validate 0.2.0 against git://github.com/chrisabrams/commonjs.git#0.2.0
bower cached git://github.com/components/jqueryui.git#1.11.2
bower validate 1.11.2 against git://github.com/components/jqueryui.git#*
bower cached git://github.com/jonom/jquery-focuspoint.git#1.1.1
bower validate 1.1.1 against git://github.com/jonom/jquery-focuspoint.git#*
bower checkout nanoscroller#master
bower invalid-meta nanoscroller is missing "ignore" entry in bower.json …Run Code Online (Sandbox Code Playgroud) 我正在使用npm-twit来获取特定帐户的关注者.
Twitter API从单个GET请求返回最多5000个结果.
如果我查询的用户有超过5000个关注者,则返回带有数据的"next_cursor"值.
为了获得接下来的5000个结果,我需要重新运行GET函数,并将"next_cursor"值作为参数传递给它.我似乎无法弄清楚如何做到这一点.
我在想一个while循环,但是我无法重置全局变量,我认为是因为范围:
var cursor = -1
while ( cursor != 0 ) {
T.get('followers/ids', { screen_name: 'twitter' }, function (err, data, response) {
// Do stuff here to write data to a file
cursor = data["next_cursor"];
})
}
Run Code Online (Sandbox Code Playgroud)
显然我不是JS的天才,所以任何帮助都会非常感激.
我有一个问题是使用simple_form在我的视图中创建工作选择枚举字段
这是我的代码:
# In model project.rb
enum status: [:draft, :published]
# In view _form.html.erb
<%= simple_form_for @project do |f| %>
<%= f.input :title %>
<%= f.input :status %>
...
<% end %>
Run Code Online (Sandbox Code Playgroud)
这是输出HTML5数字(整数增量)字段而不是选择.
如果我改为:
...
<%= f.input :status, as: :select %>
or
<%= f.input :status, as: :radio_buttons %>
...
Run Code Online (Sandbox Code Playgroud)
它输出一个选择列表/单选按钮,标签为"是"和"否".当我尝试保存时,我得到#{integer}不是有效值错误.
任何帮助,将不胜感激.