`
机器人
  • 浏览: 83293 次
  • 性别: Icon_minigender_2
  • 来自: Google
社区版块
存档分类
最新评论
文章列表
关于Rails View中的tag:select相关 select_tag主要是用于简单的生成select下拉框,如 select_tag "count", "<option>1</option><option>2</option><option>3</option><option>4</option>" 可以将它和options_for_select配合使用。 options_for_select主要是用来生成select下拉框中的option组,如 o ...
存放代码片断 Proc可以将要执行的一些代码片断放在一起,却不立即执行,而是在后来我们想要执行它的时候来调用。 say_hello = Proc.new { puts "Hello!" } # 代码不会立即执行 say_hello.call # 现在我们来调用运行Proc的存放的代码 # => "Hello!" 用Proc来组织我们的代码 Proc是组织代码的好工具,比如现在我们要测试一下某些代码的执行花费时间,通过Proc可以很灵活地做到这一点: def time(a_proc) start = Time.now a_ ...
function select_all(){ var inputs = document.getElementsByTagName('input'); for(var i=0;i<inputs.length;i++) { if(inputs[i].getAttribute('type')=='checkbox') { inputs[i].checked = true; } } } function reverse_select_all(){ var in ...
在controllers/application.rb中加如下的过滤器代码,优雅又实用。 before_filter :session_expiry, :except => [:login, :logout] before_filter :update_activity_time, :except => [:login, :logout] def session_expiry @time_left = (session[:expires_at] - Time.now).to_i unless @time_left > 0 reset_sess ...
http://www.elctech.com/tutorials/subdomains-rails-and-tld-s
http://tkool.jp/products/rpgxp/eng/index.html
<?xml version="1.0" encoding="utf-8"?> <mx:Application paddingTop="0" paddingLeft="0" paddingRight="0" paddingBottom="0" xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" width="100%" ...
http://www.yupoo.com/albums/view?id=ff8080811fcb94c9011fd63763f25415 友情链接:http://www.cqror.com/myblog
第一种方法: config.gem 'mislav-will_paginate', :lib => "will_paginate" 第二种方法: 在 Rails::Initializer.run do |config| end 后面加上 require "will_paginate"
select table_name from user_tables; 啊!这个也可以的: select table_name from tab; 友情链接:http://www.cqror.com/myblog
一台linux服务器作为大家共同使用的工作站,每个开发人员在上面都有帐号, 然后配置samba,为每个开发人员配置一个samba帐号。 然后在开发人员各自的xp上建议远程samba文件目录映射,远程开发程序,远程启动调试等,实现了开发人员的统一linux开发环境。 哈哈,这样才体现了linux作为服务器的优势嘛。
VIM 使用http://www.chinalinuxpub.com/doc/pro/vim.html 引用为了创建一个符号链接,输入: ln -s /tmp/test test 这会在当前的目录中创建符号链接 test。 test 文件指向 /tmp/test 文件。如果 /tmp/test 文件已经存在了,那么 cat test 命令可以列出其内容。 vimrc:vim的配置文件 set nu! colo torte set nocompatible source $VIMRUNTIME/vimrc_example.vim source $VIMRUNTIME/mswin. ...
<!-- 载入纯静态的xml数据 --> <mx:HTTPService id="countriesService" url="http://www.rightactionscript.com/states/xml/countries.xml" /> <mx:HTTPService result="handleXML(event);" fault="handleFault(event);" id="xmlRPC" resultFormat="e ...
本机器人自出生到现在,对历史一点都不了解,我都不知道我是如何被你们造出来的,所以我要知道历史,我要了解历史,我爬啊爬啊,找到了git,它能让我在历史时光中穿梭。 Git魔法 英文版文 http://www-cs-students.stanford.edu/~blynn/gitmagic/ 中文版本 http://docs.google.com/View?id=dfwthj68_675gz3bw8kj 我上传的附件中是中文版本的pdf
虽然我是被指定的,但是我有时也想随机一下,思考了一下,以下的方法可以让随机的显示信息列表给你们。 两种方法: 第一种方法: class Array def random a=self.dup result=[] self.length.times do result << a.slice!(rand(a.length)) end return result end end x=1,2,3,4,5 => [1, 2, 3, 4, 5] irb(main):107:0> x.random => [1, 4, 5, 2, 3] irb( ...
Global site tag (gtag.js) - Google Analytics