5fpro / rails4-template Goto Github PK
View Code? Open in Web Editor NEWrails4-template
rails4-template
article / 文章
category / 分類
tag / 標籤
page / 靜態頁
user / 使用者
cover / 封面
attachment / 附件
menu / 選單
原本 rename
https://github.com/morshedalam/rename 只支援到 rails 3
https://github.com/negativetwelve/rails-rename 有支援 rails 4,可考慮改用
例如:
某一些 CMS 系統 的某些 table article 需要比較嚴謹的發佈方式
title, content, pic (前端欄位)
title_pr, content_pr, pic_pr (後端欄位)
後台編輯時,僅能編輯 *_pr 欄位
按下「發佈」時,直執行 欄位資料複製到 前端欄位
好處:
後台可隨意按下 save,前台不會立刻受到影響,還可以 reload 還原
按下「發佈」時才會 push 給前端
壞處:
多了欄位,要多「發佈」動作
integer
, float
, date
admin
namespace model_filtering
view & debug sql管理方式
https://github.com/5fpro/election2016-official/blob/develop/app/lib/meta_context.rb#L4
def render *args
# 包含 namespace 判斷
# EX1: PostsController#press => meta_for_posts_press
# EX2: Admin::FlagsController#show => meta_for_admin_flags_show
method_name = "meta_for_#{controller_path.underscore.gsub(/\//, '_')}_#{action_name}"
meta_data = self.respond_to?(method_name) ? send(method_name) : meta_for_default
set_meta(meta_data)
super
end
sometimes we need to treat "0", 0, "" as false
value
目前的 branch 有 master
, with-assets
想要開一個純 API 目的的 branch,裡面會有 error 的統一格式處理,同時也包含 user sign 後的 token 處理
可能會有混合型的需求,例如同時有前端、也有 API 都在同一個 app 內
@phrase5036 @kzdahlia @ohmkao 有沒有其他的想法?
部分區域 loading 效果
https://github.com/kristianmandrup/masonry-rails
整頁的 loading 效果
https://github.com/caarlos0/nprogress-rails
gem pundit
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.