上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 44 下一页
摘要: 视频:https://gorails.com/episodes/form-objects-design-pattern?autoplay=1 git代码 :https://github.com/gorails-screencasts/gorails-episode-179/blob/master/a 阅读全文
posted @ 2018-09-02 21:00 Mr-chen 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 视频:https://gorails.com/episodes/decorators-from-scratch?autoplay=1 装饰设置风格:把Model层变的干净,但不使用app/helper。model层只保留scope, has_many等等。 方法:把view中的和数据库关联的逻辑移动 阅读全文
posted @ 2018-09-02 12:08 Mr-chen 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 扩展:ActionController::Base < Metal 2个基本主题: Get and Show do and redirect Requests 每个请求,由router决定了controller和action keys。剩下的请求参数,the session, 和所有http hea 阅读全文
posted @ 2018-08-31 11:00 Mr-chen 阅读(252) 评论(0) 推荐(0) 编辑
摘要: eeting-up app: 完成一个需求: 完成:https://github.com/chentianwei411/meeting-up-app 第四步实现API接口 Add api base and user controller 1. 生成controller rails g control 阅读全文
posted @ 2018-08-28 21:05 Mr-chen 阅读(850) 评论(0) 推荐(0) 编辑
摘要: 1、alias 是 Ruby 的一个关键字,因此使用的时候是 alias :new name :oldname,而 alias_method 是 module 类的一个方法,因此使用的时候是 alias_method(:newname, :oldname)有一个逗号 2、alias_method 可 阅读全文
posted @ 2018-08-27 11:43 Mr-chen 阅读(320) 评论(0) 推荐(0) 编辑
摘要: https://gorails.com/episodes/login-with-facebook?autoplay=1 大概看了一遍,留了视频的截图。 https://gorails.com/episodes/login-with-multiple-oauth-providers?autoplay= 阅读全文
posted @ 2018-08-25 19:48 Mr-chen 阅读(1118) 评论(0) 推荐(0) 编辑
摘要: SSO:用户一次登陆后在多个系统免登录。 博客gem 'doorkeeper' https://i.cnblogs.com/EditPosts.aspx?postid=9255973 OAuth:用户授权第三方应用访问自己的资源无需提供账号密码。 1. 维基百科: OAuth(开放授权)是一个开放标 阅读全文
posted @ 2018-08-24 17:30 Mr-chen 阅读(5579) 评论(0) 推荐(0) 编辑
摘要: 在购物网站,填写收货地址的时候,会出现XX省XX市XX区的下拉菜单,如何实现此功能?思路是什么? 功能设置: 当选择省select菜单后,市的select菜单为这个省的城市列。 当选择市菜单后,区菜单为这个市的各个区的列。 思路: 具体案例: git: https://github.com/chen 阅读全文
posted @ 2018-08-24 10:25 Mr-chen 阅读(638) 评论(0) 推荐(0) 编辑
摘要: Filters是继承的,所以可以在ApplicationControlooer中设置filters。 如果有多个过滤,它们执行的顺序 阅读全文
posted @ 2018-08-23 10:22 Mr-chen 阅读(472) 评论(0) 推荐(0) 编辑
摘要: class StudentsController < ApplicationController def show @student = Student.find(params[:id]) render json: @student.to_json(:include => {:courses => 阅读全文
posted @ 2018-08-20 23:29 Mr-chen 阅读(306) 评论(0) 推荐(0) 编辑
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 44 下一页