上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 41 下一页
摘要: Merge k sorted linked lists 阅读全文
posted @ 2016-09-08 14:36 冰凌花花~ 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 最近在处理一个小功能,每个元素可以有多个图片,每个图片的name表示了它是背景图还是海报图, 需要对每个元素的图片name做一个唯一性验证,一个元素不能添加两个海报图, 需要使用的是validates_uniqueness_of http://api.rubyonrails.org/classes/ 阅读全文
posted @ 2016-09-07 11:32 冰凌花花~ 阅读(477) 评论(0) 推荐(0) 编辑
摘要: 在图片管理里添加了校验方法之后,发现在更新的时候页面不显示校验报错的信息 update!在校验的时候会抛出异常,导致ajax操作中断, 原因是在controller的update方法里加了!,变成了update!(component_params), 去掉后的方法如下 去掉后的log如下 阅读全文
posted @ 2016-09-06 16:25 冰凌花花~ 阅读(330) 评论(0) 推荐(0) 编辑
摘要: 这次做新项目的时候,把图片都放在了一个表里,其他表中不再存图片信息,通过多态关联建立表之间的关系。 (1)新建picture表, component表不需要处理 (2)关于model的关联 多态关联的文档 http://guides.rubyonrails.org/association_basic 阅读全文
posted @ 2016-09-02 14:49 冰凌花花~ 阅读(577) 评论(0) 推荐(0) 编辑
摘要: rails web app页面之间的跳转的时候使用ducument.ready只有在再次加载的时候才生效, 因为rails用了turbolinks, https://github.com/turbolinks/turbolinks/blob/master/README.md#running-java 阅读全文
posted @ 2016-09-01 10:01 冰凌花花~ 阅读(455) 评论(0) 推荐(0) 编辑
摘要: 在component表里用text类型的字段存储hash数据 (1)新建字段 ,这是migration的内容 (2)controller (3)model (4)_component.html.erb (5)_form.html.erb 参考资料 http://vladexologija.blogs 阅读全文
posted @ 2016-08-31 16:54 冰凌花花~ 阅读(166) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. 给出一个所有元素以升序排序的单链表,将它转换成一棵高度平衡的二分查找树 阅读全文
posted @ 2016-08-29 11:58 冰凌花花~ 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 任何时候,你都有可能需要撤消刚才所做的某些操作。接下来,我们会介绍一些基本的撤消操作相关的命令。请注意,有些撤销操作是不可逆的,所以请务必谨慎小心,一旦失误,就有可能丢失部分工作成果。 有时候我们提交完了才发现漏掉了几个文件没有加,或者提交信息写错了。想要撤消刚才的提交操作,可以使用 --amend 阅读全文
posted @ 2016-08-25 14:09 冰凌花花~ 阅读(350) 评论(0) 推荐(0) 编辑
摘要: Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example,Given:s1 = "aabcc",s2 = "dbbca", When s3 = "aadbbcbcac", ret 阅读全文
posted @ 2016-08-24 14:53 冰凌花花~ 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Given two strings, find the longest common substring. Return the length of it. Example Given A = "ABCD", B = "CBCE", return 2. Given A = "ABCD", B = " 阅读全文
posted @ 2016-08-24 11:13 冰凌花花~ 阅读(144) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 41 下一页