06 2016 档案
rails 配置使用mysql
摘要:1 在gemfile中要添加 gem 'mysql2' 2 在mysql数据库中创建三个数据库 dept_dev dept_test dept_pro 3 配置文件 阅读全文
posted @ 2016-06-25 10:03 c3tc3tc3t 阅读(608) 评论(0) 推荐(0)
rails中两种回滚-reversible和revert区别【更新】
摘要:1 通常迁移内容写在change方法中 ,但是有些迁移内容不能自动通过执行rake:rollback回滚, 所以在迁移文件里要使用 reversible 方法,告诉rails如何回滚例如下面 # coding: utf-8 class ExampleMigration < ActiveRecord: 阅读全文
posted @ 2016-06-17 16:03 c3tc3tc3t 阅读(704) 评论(0) 推荐(0)
centos7安装mysql
摘要:centos7安装mysql 1 查找系统是否安装了myql rpm -q mysql mysql-server1.1如果安装了。就删除 sudo yum -y remove mysql mysql-server sudo rm -rf /etc/my.cnf 2 安装依赖 sudo yum ins 阅读全文
posted @ 2016-06-17 08:05 c3tc3tc3t 阅读(340) 评论(0) 推荐(0)
脱离rails 使用Active Record
摘要:目录结构 database.yml 001_schema.rb customer.rb ar.rb Gemfile Rakefile 使用说明 在程序目录先执行 bundle install 1 在ruby目录执行 命令: 2 在ruby目录创建 active_record.rb 我在rubymin 阅读全文
posted @ 2016-06-15 14:43 c3tc3tc3t 阅读(258) 评论(0) 推荐(0)
.nil? .empty? .blank? .present? in Ruby on Rails
摘要:1 We get confused when there are many options to choose from. Same is the case when it comes to use any one from the above list. But one needs to be careful in using them and it is better that we un... 阅读全文
posted @ 2016-06-06 16:58 c3tc3tc3t 阅读(223) 评论(0) 推荐(0)
网站用户行为数据统计与分析之一:埋点代码设计
摘要:原文:http://www.aiuxian.com/article/p-1442657.html 代码分析: 此段代码也不难理解,有几个地方我捎带讲解一下: uuid,在这里我把它定为用户访问唯一标识符,更多有关uuid的资料,大家上网查。 _utmc,用来标识一段时间内,如果用户不断刷新,我们算一 阅读全文
posted @ 2016-06-05 11:42 c3tc3tc3t 阅读(1113) 评论(2) 推荐(0)