Mac OS X 背后的故事里不是说,Linux 的代码质量不肿么高,还好 Mac 没用上么....
有一些 C 的 gem 不好用
还以为你说的是这个。。。。
手势很好用啊,不过我除了用 MacVIm 写代码时不用鼠标,另外时候都用的
我去 IRC 问了...
The topic for #documentcloud is: Discussion for DocumentCloud, Backbone.js, Underscore.js, Jammit, etc. DocumentCloud.org users, don't hesitate to ask jashkenas or knowtheory for help. (1:16:30 PM)
1:18:02 PM winfield: Hi, all. I have a question: why "you should never be using leading slashes with Backbone routes" ?
1:18:29 PM tbranyen: bad stuff may happen
1:18:43 PM dator: computer explodes
1:19:20 PM winfield: tbranyen: what kind of `bad stuff` ?
broofa left the room (quit: Ping timeout: 252 seconds). (1:19:46 PM)
danzik17 left the room (quit: Ping timeout: 276 seconds). (1:20:06 PM)
1:20:25 PM tbranyen: winfield: like your routes won't trigger and you'll wonder why
1:20:33 PM tbranyen: and then you'll realize you shouldn't have done that
1:21:40 PM winfield: tbranyen: I understand this, but why not a leading slash in router. Twitter has the leading slash
1:22:59 PM paul_irish: Wait is that saying example.com/app/#/dashboard is bad bad?
1:23:15 PM jvdev: http://www.webpronews.com/twitter-hashbang-urls-will-soon-be-a-thing-of-the-past-2012-02
1:23:25 PM tbranyen: winfield: pushstate woes
1:23:35 PM tbranyen: so it gets stripped now and won't match your routes
1:23:40 PM tbranyen: iirc
1:25:01 PM tbranyen: // Cached regex for cleaning leading hashes and slashes .
1:25:15 PM tbranyen: so yeah routeStripper appears to do that
1:25:45 PM paul_irish: but pushState is opt-in
1:25:55 PM winfield: tbranyen: could you explain to me a litter bit more, why leading stash doesn't get long with pushstate
braddunbar [[email protected]] entered the room. (1:26:50 PM)
austinbv [[email protected]] entered the room. (1:26:56 PM)
gauzmps left the room (quit: Ping timeout: 245 seconds). (1:27:08 PM)
1:28:46 PM tbranyen: paul_irish: ya looks like it'll only run that regex on pushstate
1:28:59 PM tbranyen: i guess i've always been extra cautious and kept my routes ambiguous
1:29:17 PM paul_irish: but
1:29:41 PM paul_irish: if i pushState({},'', '/omgrootpath/thing');
1:30:00 PM paul_irish: nothing breaks unless I don't support that URL
bobspryn [[email protected]] entered the room. (1:30:15 PM)
1:30:31 PM paul_irish: in pushState mode, you're signing up for all sorts of URL support that you dont need to worry about with #s
louissmit left the room (quit: Quit: louissmit). (1:30:36 PM)
1:30:51 PM paul_irish: but leading slashes is just one of those things you make a call about
1:31:24 PM paul_irish: i guess here's a usecase that winfield would find legit...
1:31:57 PM paul_irish: i just linked you to view a shoe on my store .. it's actually a SPA but it's got sweet URLs
1:32:17 PM paul_irish: shoestore.com/view/SH324234/awesome-bling-gold-sneaks/
1:32:23 PM paul_irish: you click the home logo
1:32:29 PM paul_irish: shoestore.com/home
1:32:46 PM paul_irish: You need leading slashes in that pushState
1:33:19 PM tbranyen: when you navigate you would use leading yeah
1:33:34 PM tbranyen: i'm testing right now if a matched route would work with leading
1:33:39 PM tbranyen: i don't think it will
1:34:01 PM paul_irish: ah. merely matching the routes..
joshontheweb [[email protected]] entered the room. (1:34:08 PM)
broofa [[email protected]] entered the room. (1:34:09 PM)
1:34:22 PM dator: Could anyone tell me why Im getting a error from underscore with this code? (TypeError: 'undefined' is not an object (evaluating 'func.bind')) Code => http://pastebin.com/3r0tQbqg
1:34:49 PM tbranyen: yeah breaks on empty route too
1:34:56 PM tbranyen: "" is needed, not "/"
1:35:08 PM jvdev: dator: no 'unrender' method
1:35:34 PM tbranyen: thats with hash too
1:35:38 PM paul_irish: without leading you woudlnt be able to differentiate between x.com/dashboard and x.com/support/dashboard
1:35:49 PM dator: jvdev: I took that out and replaced it with remove, but remove is a built in function right? so do i need to bother with binding a built in function?
1:35:53 PM paul_irish: in routes
1:37:11 PM winfield: so it's just a personal preference in Backbone ?
1:37:34 PM winfield: with no leading slash in router
austinbv left the room (quit: Quit: austinbv). (1:37:43 PM)
1:37:44 PM tbranyen: hrm
1:37:47 PM dator: jvdev: thank you btw
1:37:49 PM jvdev: dator: depends what's calling it. if it's only being used in the scope of the class, no
1:38:10 PM tbranyen: paul_irish: i don't think thats a problem with backbone, support/dashboard would superscede it and dashboard on its own wouldn't match
1:38:29 PM tbranyen: er precede it
1:38:41 PM paul_irish: ok
1:38:50 PM paul_irish: then i have no more arguments!
1:38:56 PM paul_irish: death to leading slashes in routes!
1:39:01 PM tbranyen: lol if you want to be safe
1:39:10 PM tbranyen: i was using them before in this client project that was using the #!
1:39:20 PM kmiyashiro: backbone .9 took out preceeding slash support I think, probably wouldn't be hard to patch it back in if you need it
1:39:33 PM tbranyen: since thats what the existing app did
kmiyashiro left the room (quit: Quit: kmiyashiro). (1:40:53 PM)
njero left the room (quit: Read error: Connection reset by peer). (1:41:06 PM)
njero [[email protected]] entered the room. (1:41:23 PM)
shaunxcode left the room (quit: Ping timeout: 252 seconds). (1:41:51 PM)
1:42:33 PM tbranyen: ah heres another big deal with hash and pushState
1:42:50 PM tbranyen: if you navigate with leading slashes with hash, #/my_route and send that link to someone who has pushState
1:42:53 PM tbranyen: http://127.0.0.1:8000//dashboard
1:42:58 PM tbranyen: thats what it converts to
1:43:11 PM tbranyen: which is probably unintended and won't match routes correctly
1:44:49 PM tbranyen: winfield: i'd say its only preference, if you always intend on using hash and you make sure to bind "" and "/" to your routes for the index
efazati left the room (quit: Read error: Operation timed out). (1:45:26 PM)
1:46:32 PM winfield: tbranyen: i hate hash… just try to understand why leading slash doesn't play well with pushState
1:46:38 PM tbranyen: see above
1:47:15 PM winfield: tbranyen: yes, it makes sense
1:47:22 PM tbranyen: if you use a leading slash and your user has only hash support and shares http://mylink.com#/leading it gets converted to http://mylink.com//leading with pushState enabled browsers
1:48:31 PM tbranyen: thx for the questions tho paul_irish, i want to write this up in the boilerplate docs
1:49:01 PM tbranyen: i knew there were reasons why i played it safe
直接删了重装好了么....
原来花花绿绿的倒还受的了...现在这样...太悲剧了....
换凤姐头像 +1 , 哈哈
sign -> Sign ?
@params -> params ?
GJ~
应该是 ffi 这个 gem 的问题。
是不是最近才换的 Homebrew?
会不会是 PATH 里有 opt 啊?
自己写...看起来很简单的样子....
1, 先用"net/http"去找一下看看?
Mongo 没有 schema, 无所谓迁移了。要加个字段,直接就 model 里加上就行
页面上一个 link_to...:method=>:delete
哪个啊?任意一个?
没看肿么明白你的问题,不知道这个对你是否有帮助:
https://github.com/plataformatec/devise/blob/master/lib/devise/rails/routes.rb#L92
像 Ruby China 这类项目,我倒觉得用 nosql 更加灵活方便呢
active_record
中类似Topic.find(params[:id])
这种是to_i
过的。
我还是喜欢有一个固定永久的 URL,有洁癖。不大懂 SEO,不知道固定永久的 URL 对 SEO 有没有帮助
Ruby 是 1.9.2 的 http://devcenter.heroku.com/articles/cedar#stack_software_versions
Rails 3.2 应该没问题
@LeveyZhu ..................
这个是大浪搞的啊。。。
@huacnlee 搞两套排序如何?一套 vote, 一套楼层数?
像问答这种就默认设置成按 vote 排序,类似 stackoverflow
你用的神马版本?2.0 么? 如果是,2.0 不包含 migration 的 help 了,需要自己明确表结构
https://github.com/plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.0-migration-schema-style
vote 好了,比如 vote 过 10 就高亮
去 github 提 Issue 吧,方便管理和讨论
乃启的是 Apache 还是 Webrick 啊?
喂,你们离题了吧?