20180126
肖威工作总结
- 上午:完成前端welcome的页面布局梳理+动态数据呈现的梳理;
- 下午:查看modle结构下的control中的views的原理,使用root完成支付功能的实现;
- 晚上:完成heroku的专案的部署和阿里云的部署,熟悉专案的部署流程体系;
推荐阅读文章: 田文艺: 研究所這條路:升學、研究、社交、謀職一把罩的研究所生存術 http://tech-marsw.logdown.com/blog/2015/01/31/digest-getting-what-you-came-for-the-smart-students-guide-to-earning-a-masters-or-phd#ch1
张家琛、杨吉堂: [学习笔记] 招聘网站实作流程复盘 http://nathanye.logdown.com/posts/2027650 [学习笔记]简单5步暴力拿下全栈营直播视频 http://nathanye.logdown.com/posts/2474792-note-download-video
张家琛工作总结
上午:支付逻辑梳理 上午精力充沛,时间拿来攻坚克难最合适
下午:1.product_list new,show,edit的html页面;ProductList不能新建一笔资料
引用lib config.autoload_paths += %W·[#{Rails.root}/lib] module MasterRailsByActions class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. # Rails 5中在生产环境下autoload_paths并不会自动加载,需要下面的配置重新启用 config.enable_dependency_loading = true config.autoload_paths += %W·[#{Rails.root}/lib] # 将lib自动加载进来 config.generators do |generator| generator.assets false generator.test_framework false generator.skip_routes true end end end
- 不是管理员不能进入界面,管理员界面 功能实作
第一步 class Admin::ProductsController < ApplicationController before_action :authenticate_user! before_action :admin_required end 第二步 class ApplicationController < ActionController::Base def admin_required if !current_user.admin? redirect_to "/", alert: "You are not admin." end end 第三步 class User < ApplicationRecord def admin? is_admin end end- 如何写seeds
u = User.new(email: "[email protected]", password: "123456", password_confirmation: "123456") u.save #保存model到数据库 u.is_admin = true u.save #更新数据库- 管理员New 页面填写后,要跳转到admin/products/show.html.erb @product前面要加:admin,并且要用中括号包住
<%= form_for [:admin, @product] do |f| %> 标题 <%= f.text_field :title %> <br> 叙述 <br> <%= f.text_area :description %> <br> <%= f.submit "Submit", :disable_with => 'Submitting...' %> <% end %>
田文艺工作总结
- 上午:微信推送
- 下午:加视频字幕
杨吉堂工作总结
- 增加bootstrap flash 功能、安装simpleform with bootstrap、font-awesome-rails
- 实作后台CRUD
- 建立管理后台
- 增加商品详情栏位
解决heroku上传的问题,在于pg和sq的版本太低; http://blog.csdn.net/tse_e/article/details/54618757
- 使用这个版本可以部署成功;
新增pg gem 至生产环境
group :production do gem 'pg', '0.18.4' end
将 sqlite3 移入开发环境[原有代码,修改]
group :development, :test do gem 'sqlite3', '1.3.12' gem 'byebug', '9.0.0', platform: :mri end
- 才华横溢css地址: https://caihuahengyicss.herokuapp.com