上一页 1 ··· 40 41 42 43 44
摘要: 错误❌: 1.belongs_to :job, dependent: :destroy //尝试删除一条resumen后,job没有同步删除?? 答:建立一对多的关系,如job和resume。应该在job中has_many :resumes, dependent: :delete_all 或者des 阅读全文
posted @ 2017-12-03 11:08 Mr-chen 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 错误, 1 如果增加了一个migartion,却没有migrate进数据库,运行程序会报告❌,提示 pending 2 使用gem carrierwave.后在index.html.erb中<%= link_to("Download Resume", resume.attachment)%> 会报告 阅读全文
posted @ 2017-12-01 11:25 Mr-chen 阅读(116) 评论(0) 推荐(0) 编辑
摘要: the rails philosophy includes two major guiding principles: Don't repeat yourself: DRY is a principle of software development which states that "Every 阅读全文
posted @ 2017-11-29 09:30 Mr-chen 阅读(169) 评论(0) 推荐(0) 编辑
摘要: ❌错误 1. @job.resume.count: 提示❌ undefined method `resume' ✅: @job.resumes.count //解释:调出某一个job的所有简历,所以需要+s 2.rails g controller admin/resumes. //解释: 这是与后 阅读全文
posted @ 2017-11-28 10:33 Mr-chen 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 回想Rails --Active Record Query Interface--Scopes的基本用法: 1.Passing in arguments.例子:scope :name , -> {order("..")} 2.Using conditionals. scope :name, -> { 阅读全文
posted @ 2017-11-27 19:54 Mr-chen 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 在seed文件中输入一些预加载的种子job,注意属性和值都要有: 正确✅: for i in 1..10 do Job.create(title:"No#{i}",description:"这是关于No#{i}的介绍",wage_upper_bound: rand(50..99)*100, wage 阅读全文
posted @ 2017-11-26 19:03 Mr-chen 阅读(234) 评论(0) 推荐(0) 编辑
摘要: http://guides.rubyonrails.org/layouts_and_rendering.html 中文 This guide covers the basic layout features of Action Controller and Action View After rea 阅读全文
posted @ 2017-11-26 16:37 Mr-chen 阅读(236) 评论(0) 推荐(0) 编辑
摘要: http://fontawesome.io/examples/ content_tag(:i,"", class:"fa fa-lock fa-spin fa-lg fa-fw) //用<i>或者<spin> fa-spin:可以让图标icon旋转 fa-lg(fa-3x):让图标比例放大 (Lar 阅读全文
posted @ 2017-11-26 16:33 Mr-chen 阅读(211) 评论(0) 推荐(0) 编辑
上一页 1 ··· 40 41 42 43 44