08 2014 档案
摘要:class SwitchesController [:index, :show] def index end def show end #存储拓扑 def topo @vts = VmToSwitch.all @sts = SwitchToSwitch.all @st...
阅读全文
摘要:Click hereOr hereOr even here
阅读全文
摘要:rails nameerror uninitialized constant classwill occur if your rails console is not loaded with configuration of the class file containing method bein...
阅读全文
摘要:之前先在initializers 文件夹下建立了一个task.rb ,rails服务启动的时候执行,本地没问题,可是服务器上启动了3个进程,会执行3遍,解决方法是 把task.rb 放到 script/文件夹下,然后在项目根目录执行 ruby script/task.rb production &。...
阅读全文
摘要:先安装环境sudo apt-get install python-paramikosudo apt-get install python-pysqlite2当然mysql要装好还要装sudo apt-get installlibmysqlclient-dev下载MySQL Workbenchwb@u...
阅读全文
摘要:如果提示安装libmysqlclient16则用libmysqlclient-dev 代替之
阅读全文
摘要:把database.yml的adapter改为mysql2把Gemfile文件中的gem mysql改为gem mysql2
阅读全文
摘要:file是以_开头命名的文件,比如_cart.html.erb这样就可以用render来调用了还可以传参数比如rails 2.0p87传一个集合render(:partial => "cart_item", :collection => @cart.items)这样局部模板就得到了一个变量如cart...
阅读全文
摘要:web敏捷开发 p317depot > ruby script/console>>rs = ActionController::Routing::routes可以简单测试比如>>puts rs.routes>>rs.recognize_path "/store">>rs.generate :cont...
阅读全文
摘要:ubuntu 12.04绑定rrdrubygem install librrd用来装rrdruby,这样才能找到RRD.so文件然后在rb文件中加入这两句话:$: << '/path/to/rrdtool/lib/ruby/1.8/i386-linux'require "RRD"debian一开始g...
阅读全文
摘要:rails new demo --database=mysql最后报错Gem files will remain installed in D:/BillFiles/rails_dev/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.15 for inspec...
阅读全文
摘要:怎么办呢。。。哎。。。突然就必须全选中了。。。。但是。。。一不小心想到在g里面都添加circle和rect但是根据tpye可以让circle的r为0或者rect的width和height为0,这样不就只能实现一个了么~~~嘿嘿
阅读全文