(本篇作废,不要安装 这个gem ,要使用  gem 'ckeditor',  见: http://siwei.me/blog/posts/ckeditor-gem) ckeditor的用法极其简单: (refer to: ) 1. gem 'ckeditor_rails' 2. Add to your app/assets/javascripts/...
Railsspring:另一个railssprocketwatch.极大节省你的时间
2010/2011年左右,我尝试过使用 rails sprocket/watch, 确实能快速节省时间。 缺点是每次修改完 config 文件之后,必须重新启动 sprocket server. 如果不启动,就会产生各种麻烦。 而且我个人是个喜欢 随时保存( :w ) 的人,所以每次保存vim都会引起不必要的报错,让我对这个不太感冒。 不过今天还是试试spring 吧,毕竟  ti...
使用carrierwave上传图片(usingcarrierwavetouploadimages)
注意: 以下仅支持 carrierwave  0.9.0 版本. 0.10.0 与 1.0 版本的用法略有变化, 请注意查看官方文档  1.0 版本仅支持 ruby 2.0 与 rails 4 .  1  in Gemfile:   gem 'carrierwave', '0.9.0' 2.   $ rails generate ...
Rails4strongparameter Permitandrequire
新上手  rails4的同学可能不知道如何获取 request中的params. 其实很简单: rails 2,3:   my_name  =  params[:name] rails4 :  需要两行代码: params.permit(:name) my_name = params[:name] (切记,是需要用两行代码) ,这样的写法是错...
使用rails_config来管理配置选项
refer to:  https://github.com/railsconfig/rails_config 项目中很多常量 ( system constant) 都应该配置成 配置选项  (config items)  系统常量:  在系统运行时是固定值,并且在每个开发人员的机器上都相同。 例如:black='#ffffff' 配置选项: ...
Whichtochoose,rubymotion,swiftorobjectc?
refer to: http://blog.motioninmotion.tv/is-rubymotion-suitable-for-client-work/ In RubyWeekly I saw a link to a discussion on Reddit that was getting some good attention, and it was titled "Is Ru...
[教程]web+rails入门1大师原创
先知道 http 的原理. web app: 是 url 驱动的。 (用户的看到的UI,是根据url 的不同来进行跳转的,) mobile app: 是 event 驱动的(根据用户点击不同的按钮,来进行不同的跳转) 所以, web app 就只有两个角色参与: browser, server 一个典型的应用: 小王打开新浪网页。过程是: 1. 小王在浏览器中输入地址: ...
Rubymotion的坑:不稳定(isrubymotionstillnotsostable?)
refer to:  https://groups.google.com/forum/#!topic/rubymotion/x6-9c__IHH0, and http://www.mikekreuzer.com/2013/12/game-over-rubymotion.html and http://joshsymonds.com/blog/2013/06/26/why-im-...
Rubyv.s.object C
refer to: http://www.adamjonas.com/blog/objective-c-for-rubyists/ 看看代码就知道了: # 为某个BUTTON设置文字: # Object C: API: - (void)setTitle:(NSString *)title forState:(UIControlState)state # 实际用法: [myButton s...
几种web框架的相应速度比较(comparisionofruby,nodejs,java)
结论:  其实如果纯粹输出 Hellow world的话, 大家都差不多. 关键还是要看实际的应用情况( 读取数据库)  .  今天看到 express 框架的最好相应速度是 :  2200 req/s .一时兴起, 打算对比下 其他几种框架的速度.  使用的命令是ab: $ ab -n 1000 -c 1000 http://local...
开发rubymotion必备工具——2(must Havelibrariesforrubymotion Part2)
refer to: http://blog.arkency.com/2014/07/one-ruby-to-rule-them-all/ Must-have-one SugarCube - even better syntax for RubyMotion BubbleWrap - a lot of utilities for managing most common pl...
显示一个tree(showatreeusingruby)
参考:https://two-wrongs.com/draw-a-tree-structure-with-only-css.html 这里使用了递归 一个ruby 的helper,  Sort 的结构是: name: string,  introduction:string, parent_id: integer  module ApplicationHelp...
开发rubymotion必备工具(must Havelibrariesforrubymotion)
refer to: http://stackoverflow.com/questions/24333751/what-are-must-have-libraries-for-rubymotion Things most people use: Bubblewrap motion-cocoapods afmotion (if you need networking ) motion-ho...
Boilerplatecode——不重要,但是又没它不行的代码
经常在英文材料中看到这个词。 dict.cn, iciba给出的意思都不准确,(样板文件,钢炉锅板)。  估计“样板文件”略有其真实的意思。但实际上,我们可以翻译的再“通俗”一些。。。 from wiki:  Boilerplate codeFrom Wikipedia, the free encyclopediaIn computer programming, boil...
如何为菜单高亮(highlightcurrentmenuinrails)
使用 rails中的current_page? 方法 ,以及自制方法: <a href="/" class='<%= (request.original_fullpath.in? ['/', ''] ) ? 'active' : ''%>' >首页</a> <% Sort.where('...
使用motionkitforyourlayout&styling
refer to: https://github.com/motion-kit/motion-kit 内容很多。 The RubyMotion layout and styling gem.   最好的地方就是可以跟其他框架集成。  比如RMQ。 Crossplatform compatibility: iOS, OSX, and planned support for...
脱离rails使用activerecord(usestandaloneactiverecordwithoutrails)
refer to:  http://snippets.aktagon.com/snippets/257-how-to-use-activerecord-without-rails app.rb: require 'active_record' require 'sqlite3' require 'logger' ActiveRecord::Base.logger = Logg...
把ios的可读性发挥到极致——rubymotion Sugarcube
refer to: https://github.com/rubymotion/sugarcube ruby 这个语言就是把可读性发挥到了极致。  而 有追求的程序员都是追求极致的,所以又有了  active-support.  在 rubymotion中,大家延续了这样的风格:  sugarcube.  # 原始代码: UIApplic...
乐单软件(happysoft)招全栈攻城狮四名!
北京 乐单软件公司招全栈攻城师!  2015年2月13日更新: 名额 四 位! 大家好~ 北京乐单软件有限公司 (http://happysoft.cc, http://happymenu.cn) 由于业务快速增长,需要给力的小伙伴们的加入~ 我们是初创公司,有一个比较稳定的小团队。我是合伙人之一。全盘负责技术。我们有着宽敞明亮的办公室, 地址在三元桥地铁站霄云中心 A座 31...
使用163企业邮箱时,配置thunderbird(configureyourym.163.comemail), 以及拿来就用的railssmtp配置
refer to:  http://zhidao.baidu.com/link?url=hWaOxKtwjpxzDAKM0-V1pYKxoq3L8yWdNgy_Ds9Ap1VtnFlyMzU2ta6ULf4qySMIolMfUBHY26hfJCTP_-Bfvq 使用pop3:  pop.ym.163.com 使用smtp:  smtp.ym.163.com &...