摘要:
错误❌: 1.belongs_to :job, dependent: :destroy //尝试删除一条resumen后,job没有同步删除?? 答:建立一对多的关系,如job和resume。应该在job中has_many :resumes, dependent: :delete_all 或者des 阅读全文
摘要:
错误, 1 如果增加了一个migartion,却没有migrate进数据库,运行程序会报告❌,提示 pending 2 使用gem carrierwave.后在index.html.erb中<%= link_to("Download Resume", resume.attachment)%> 会报告 阅读全文
摘要:
the rails philosophy includes two major guiding principles: Don't repeat yourself: DRY is a principle of software development which states that "Every 阅读全文
摘要:
❌错误 1. @job.resume.count: 提示❌ undefined method `resume' ✅: @job.resumes.count //解释:调出某一个job的所有简历,所以需要+s 2.rails g controller admin/resumes. //解释: 这是与后 阅读全文
摘要:
回想Rails --Active Record Query Interface--Scopes的基本用法: 1.Passing in arguments.例子:scope :name , -> {order("..")} 2.Using conditionals. scope :name, -> { 阅读全文
摘要:
在seed文件中输入一些预加载的种子job,注意属性和值都要有: 正确✅: for i in 1..10 do Job.create(title:"No#{i}",description:"这是关于No#{i}的介绍",wage_upper_bound: rand(50..99)*100, wage 阅读全文
摘要:
http://guides.rubyonrails.org/layouts_and_rendering.html 中文 This guide covers the basic layout features of Action Controller and Action View After rea 阅读全文
摘要:
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 阅读全文