我也觉得 vim 比 emacs 用的多
@zw963 把 emacs 的配置 github 共享一下啊,以后我玩 emacs 学学
话说 vim,我现在经常耗时间在折腾插件上,玩 emacs 最大的幸福就在于,IMHO,emacs 的插件语言是 lisp,比 vim 的插件语言舒服多了。。
@hhuai 你 vim,emacs 用了多长时间啊?
#11 楼 @geekontheway 好东西
我也是,建议加一个锁定功能,用户点击按钮后,1 小时之内网站不予响应
#6 楼 @dreamrise redis-server.
#4 楼 @ShiningRay 终于明白了,谢谢 saber
def javascript_include_tag(*sources)
pp sources
puts sources.class
options = sources.extract_options!
debug = options.key?(:debug) ? options.delete(:debug) : debug_assets?
body = options.key?(:body) ? options.delete(:body) : false
digest = options.key?(:digest) ? options.delete(:digest) : digest_assets?
t = sources.collect do |source|
if debug && asset = asset_paths.asset_for(source, 'js')
pp asset
asset.to_a.map { |dep|
pp dep
super(dep.pathname.to_s, { :src => path_to_asset(dep, :ext => 'js', :body => true, :digest => digest) }.merge!(options))
}
else
super(source.to_s, { :src => path_to_asset(source, :ext => 'js', :body => body, :digest => digest) }.merge!(options))
end
end.join("\n").html_safe
#p t
end
asset_paths.asset_fo 返回了 一个带 application.js 的数组。导致如此
-_-#是不是有bug,debug模式下不该加入application.js吧。。
#10 楼 @ichord 找到原因了 @siyang1982 @huacnlee 我的环境是 development, 所以 assets.debug = true .
所以 <%= javascript_include_tag "application" %> 被扩展为
<script src="/assets/jquery.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery_ujs.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-alerts.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-dropdown.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-tabs.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-twipsy.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-buttons.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-popover.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-modal.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.jdialog.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.timeago.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.timeago.settings.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.hotkeys.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.chosen.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.autogrow-textarea.js?body=1" type="text/javascript"></script>
<script src="/assets/social-share-button.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.at.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.caret.js?body=1" type="text/javascript"></script>
<script src="/assets/app.js?body=1" type="text/javascript"></script>
<script src="/assets/application.js?body=1" type="text/javascript"></script>
引起了事件触发两次。
难道你们都不用开发环境?
我看了 http://asciicasts.com/episodes/279-understanding-the-asset-pipeline 里面有个截图,debug 模式下确实是带 application.js 的
-_-#找到原因了,估计还是 assets-pipeline 的事。
<script src="/assets/jquery.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery_ujs.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-alerts.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-dropdown.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-tabs.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-twipsy.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-buttons.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-popover.js?body=1" type="text/javascript"></script>
<script src="/assets/bootstrap-modal.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.jdialog.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.timeago.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.timeago.settings.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.hotkeys.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.chosen.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.autogrow-textarea.js?body=1" type="text/javascript"></script>
<script src="/assets/social-share-button.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.at.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.caret.js?body=1" type="text/javascript"></script>
<script src="/assets/app.js?body=1" type="text/javascript"></script>
<script src="/assets/application.js?body=1" type="text/javascript"></script>
生成的 html 代码 application.js 和 bootstrap-dropdown 都挂了一次按钮触发事件,所以就打不开了。实际上是点了两次。。。。。。分析中。。。。郁闷啊
有折腾了半天,还是没解决,跟踪到 bootstrap-dropdown.js, 如果在这个函数的 return false 处设断点,这个下拉菜单就出来
$.fn.dropdown = function ( selector ) {
return this.each(function () {
$(this).delegate(selector || d, 'click', function (e) {
var li = $(this).parent('li')
, isActive = li.hasClass('open')
clearMenus()
!isActive && li.toggleClass('open')
return false
})
})
}
过了这个函数,下拉菜单就没了。。高手帮忙看看啊。。郁闷
#2 楼 @dreamrise deploy 这东西我也没玩过,毕竟是自己玩。好像是自动发布到 web 服务器上的东东。可以理解为一个强大的 shell 脚本,一个命令,你本机的东西就部署到服务器上了。ruby-china 在本机跑,用 rails s 就可以了。但是我遇到个问题,就是 bootstrap 的 gem 里的 js,css 好像没进 assets pipeline。正解决中。。。
-_-# 我用 ln -s ...是不是太土了。。。
@xds2000 我是真想去。等小孩稳定下来吧。。。linux + c + ruby.. 都是我喜欢的。。。
这个 logo 不错!!!!颜色再调调
我用过,感觉不好,无力吐槽
-_-# 为什么没人提 ruby-china???有些难? shopqi 用的 gem 更多啊
rails guide 有!
2.1 Asset Organization Pipeline assets can be placed inside an application in one of three locations: app/assets, lib/assets or vendor/assets.
app/assets is for assets that are owned by the application, such as custom images, JavaScript files or stylesheets.
lib/assets is for your own libraries’ code that doesn’t really fit into the scope of the application or those libraries which are shared across applications.
vendor/assets is for assets that are owned by outside entities, such as code for JavaScript plugins and CSS frameworks.
#28 楼 @zhang_victor 哦,据说不支持了,在以前那个年代是可以 debug 的。。。。拿老版本的搞吧。。。rubymine 收费,找破解麻烦
#25 楼 @zhang_victor ruby debugger,有空我学学。IDE DEBUGER,再开一个 netbeans 太麻烦了。
#4 楼 @huacnlee 就是鼠标点击 上面图片的 jinleileiking, 出不来下拉菜单,直接进入http://ruby-china.org/users/jinleileiking