随笔分类 -  form表单

摘要:注意不要用event.keyCode, https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent js代码 resetBankAccountNumber(id) { this.setBankAccountValidity('ownB 阅读全文
posted @ 2019-09-19 05:43 冰凌花花~ 阅读(353) 评论(0) 推荐(0)
摘要:The SanitizeHelper module provides a set of methods for scrubbing text of undesired HTML elements. These helper methods extend Action View making them 阅读全文
posted @ 2016-12-14 17:18 冰凌花花~ 阅读(226) 评论(0) 推荐(0)
摘要:Numeric Inputs Numbers are even easier to validate than text. For number input types, the HTML5 spec gives youattributes like min, max, and step. Each 阅读全文
posted @ 2016-06-09 17:44 冰凌花花~ 阅读(185) 评论(0) 推荐(0)
摘要:(1)首先给每一行进行id的标注,并且修改edit链接,使它的remote: true,请求类型是json格式,在这个链接上,增加class:editProductLink,这样在我们点击链接的时候,会执行一个动作,app/views/products/_product.html.erb"> ... 阅读全文
posted @ 2015-10-27 18:25 冰凌花花~ 阅读(394) 评论(0) 推荐(0)
摘要:(1)首先给删除按钮增加一个属性 remote: true,这样ujs将这个click动作转化为ajax调用,app/views/products/_product.html.erb"> _name"> _price"> _description"> t("helpers.... 阅读全文
posted @ 2015-10-27 18:02 冰凌花花~ 阅读(499) 评论(0) 推荐(0)
摘要:(1) 在布局文件中将弹出层的代码和主体代码分开 (2)改写添加商品的时候按钮的方法,增加data属性,里面设定当按钮点击的时候,打开哪一个model,在model的代码里,调用form这个局部模板,在下面的js代码里声明这个model,并且声明这个m... 阅读全文
posted @ 2015-10-27 17:49 冰凌花花~ 阅读(274) 评论(0) 推荐(0)
摘要:https://github.com/activerecord-hackery/ransack添加Gemfilegem 'ransack'view中代码 controller里 def... 阅读全文
posted @ 2015-10-26 15:46 冰凌花花~ 阅读(481) 评论(0) 推荐(0)
摘要:可以轻松解决post请求的调试问题 阅读全文
posted @ 2015-03-02 11:46 冰凌花花~ 阅读(287) 评论(0) 推荐(0)
摘要:reload 方法,该方法强迫浏览器刷新当前页面。语法:location.reload([bForceGet])参数: bForceGet, 可选参数, 默认为 false,从客户端缓存里取当前页。true, 则以 GET 方式,从服务端取最新的页面, 相当于客户端点击 F5("刷新") 96 @s... 阅读全文
posted @ 2015-03-02 11:33 冰凌花花~ 阅读(552) 评论(0) 推荐(0)
摘要:http://guides.rubyonrails.org/v3.0.8/action_controller_overview.html#the-flash如何在页面显示controller里的错误提示,The flash is a special part of the session which... 阅读全文
posted @ 2014-10-22 16:42 冰凌花花~ 阅读(400) 评论(0) 推荐(0)