tom2cjp / dry_view Goto Github PK
View Code? Open in Web Editor NEWThis project forked from alvin2ye/dry_view
dry_view
This project forked from alvin2ye/dry_view
dry_view
Example: 说明: 将常用的View公用, 统一了I18n # Controller class BlogController < InheritedResources::Base dry_view :columns => [:title, :body] end # Model class Blog def label self.title end end # 依赖 此功能依赖 inherited_resources( http://github.com/josevalim/inherited_resources/tree/master ) 可以用以下命令安装 script/plugin install git://github.com/josevalim/inherited_resources.git 其中 form 的布局和 Css 来自 formtastic (http://github.com/justinfrench/formtastic/tree/master) # Useage 1 ./script/plugin install git://github.com/alvin2ye/dry_view.git 2 ./script/plugin install git://github.com/josevalim/inherited_resources.git 3 ./script/generate Model Company name:string addr:string 4 rake db:migrate 5 ruby script/generate controller companies 6 # app/controllers/companies_controller.rb class CompaniesController < InheritedResources::Base dry_view end # app/models/company.rb class Company < ActiveRecord::Base def label self.name end end # config/routes.rb map.resources :companies 7 rake dry_view:install 8 add to layout: <%= stylesheet_link_tag "formtastic" %> # I18n # config/locales/zh.yml zh: dry_view: actions: "操作" view: "查看" edit: "编辑" remove: "删除" new: "新建" submit: "提交" required: "必填" cancel: "取消" return_index: "返回列表" are_you_sure: "你确认吗?" # Config class CompaniesController < InheritedResources::Base # Only display this columns, default is all columns except [:id, :created_at, :updated_at] dry_view :columns => [:name, :code] end Copyright (c) 2009 Alvin Ye at Agideo, released under the MIT license alvin.ye.cn(*)gmail.com
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.