yz00

#

[置顶] pundit

摘要: gem "pundit"Include Pundit in your application controller:class ApplicationController Headless policiesGiven there is a policy without a correspondi... 阅读全文

posted @ 2015-06-18 13:36 yz00 阅读(638) 评论(0) 推荐(0)

#

[置顶] devise 小项目(一)

摘要: Devise源于Warden,而warden是一个基于Rack的验证权限gem,不过,使用devise实际并不需要任何关于warden的知识。如果你之前有一些其他类似的维护验证权限功能的gem的使用经验的话,你会发现Devise的和他们的不同之处在于,提供了从页面到model的实现。相比而言,例如A... 阅读全文

posted @ 2015-06-06 03:28 yz00 阅读(518) 评论(0) 推荐(0)

2015年8月27日 #

Linux:-bash: ***: command not found,系统很多命令都用不了

摘要: 系统:64位RHEL6突然之间linux很多命令都用不了,均提示没有此命令。这应该是系统环境变量出现了问题导致的。出现这种可能性的原因有很多,大多数是因为,安装了新的软件要配置环境变量,但是没有按照正常程序来走,例如:path= /etc/java/apache-**这样就会吧原来path的所有可执... 阅读全文

posted @ 2015-08-27 13:04 yz00 阅读(594) 评论(0) 推荐(0)

2015年6月11日 #

rails日记1

摘要: assert_select "div" foobarassert_select "div", "foobar" foobarassert_select "div.nav" foobarassert_select "div#profile" foobarassert_select "div[name=... 阅读全文

posted @ 2015-06-11 03:58 yz00 阅读(188) 评论(0) 推荐(0)

2015年6月10日 #

ruby日记1

摘要: 1.irb参数配置~/.irbrcIRB.conf[:PROMPT_MODE] = :SIMPLE #简化 irb 提示符,以及禁用一些烦人的自动缩进行为IRB.conf[:AUTO_INDENT_MODE] = false2.注释:#单行=begin......多行=end3.字符串字符串连接>... 阅读全文

posted @ 2015-06-10 03:03 yz00 阅读(228) 评论(0) 推荐(0)

2015年6月9日 #

reduce方法

摘要: API里面这样写reduce(initial, sym) → obj reduce(初始值,符号)reduce(sym) → obj reduce(符号)reduce(initial) { |memo, obj| block } → obj reduce(初始值){ |memo ... 阅读全文

posted @ 2015-06-09 16:42 yz00 阅读(268) 评论(0) 推荐(0)

a questions

摘要: 1.2520 is the smallest nuber that can be diveded by each of the number from 1 to 10 without any remainder.what is the smallest positive number that is... 阅读全文

posted @ 2015-06-09 10:13 yz00 阅读(156) 评论(0) 推荐(0)

2015年6月6日 #

ruby 常注意的

摘要: 1.ruby中生成字符串有两种形式一种单引号,这种在使用时,对字符串不作处理,照原样输出双引号就不同了,他会查找字符串中需要替换的字符,例如\n,#{}这种都会先替换为需要的值。所以在使用的时候要注意是否有要用的值,尽可能多使用双引号。2.gets和gets.chomp()都表示读入用户的输入并用于... 阅读全文

posted @ 2015-06-06 21:08 yz00 阅读(139) 评论(0) 推荐(0)

2015年6月4日 #

rails4.2~devise邮箱测试

摘要: 1.由于网站无需验证,只需一封欢迎邮件,在config/intiailzers/devise.rb里面配置config.allow_unconfirmed_access_for = nil #2.days2.配置user--编辑app/models/user.rb文件,先写一下数据这一块class ... 阅读全文

posted @ 2015-06-04 22:02 yz00 阅读(548) 评论(0) 推荐(0)

上线记录

摘要: 登陆云端之后,发现报错如下:ssh root@47.88.0.215The authenticity of host '47.88.0.215 (47.88.0.215)' can't be established.ECDSA key fingerprint is 25:8a:5a:c8:c6:8e... 阅读全文

posted @ 2015-06-04 15:06 yz00 阅读(246) 评论(0) 推荐(0)

导航