常用gem列表 - tianlu1677/tianlu1677.github.io GitHub Wiki
列出所用的gem,并且简单介绍他的功能,这样方便检索
web应用开发框架
用于快速构建用户功能,如:注册,登陆,个人设置,修改密码,用邮件找回密码
分页控件,属于在服务器段进行分页
-
上传控件,它可以帮你处理上传图片,裁减,定义不同的图片尺寸,这个需要配合mini_magick 这个gem,来剪裁图片。 除此之外还可以上传其他类型的文件。
应用中会用到为不同用户设定不同功能的权限,制定一套完善的权限管理系统。
-
rails中将session存储在服务器端上
quiet_assets 关闭了rails的asset pipeline 日志,意味着在你的开发日志中去掉了相关编译信息。
根据schema,以注释的形式给当前的model列出相关表的字段
-
部署相关的gem
capistrano-rails
capistrano-rvm
capistrano-scm-copy
以及Net::SSH是用Ruby实现的SSH2客户端协议, 使用它可以用SSH2远程控制你的程序
用来生成rails3 model(AcitveRecord, Mongoid, Datamapper)和controller UML图 作为 跨平台的.svg文件。
-
rails的错误提示
better_errors取代了原来的rails错误提示页面,更加的友好和实用。为了使用better errors更高级的特性,需要使用 binding_of_caller这个gem。
Using binding_of_caller we can grab bindings from higher up the call stack and evaluate code in that > context. Allows access to bindings arbitrarily far up the call stack, not limited to just the immediate caller.
-
测试:rspec
BDD,行为测试驱动(Behaviour Driven Development for Ruby).
-
数据库适配器:pg
在github上没找到
inherited_resources 让你的控制器继承了所有的restful的方法(即7个方法),在项目中是
GiftsController < ResourceController(里面继承了inherit_resources) < ApplicationController
inherited_resources 依赖于 has_scope,responders
Has scope allows you to easily create controller filters based on your resources named scopes
-
responders 具体使用内容见博客,不常用
-
简化rails表单填写
这个是用来在一个表单中嵌套多个model,对需要嵌套的model需加:`accepts_nested_attributes_for`,同时在rails4中
使用的是强参数, `params.require(:project).permit(:name, tasks_attributes: [:id, :name, :_destroy])`,结合 simple_form使用,就是 `simple_nested_form_for`了
-
此gem就是在rails的asset pipeline集成了select2插件,select2是取代了原来的选择框,具有检索、远程数据和无限滚动结果的功能
所见即所得编辑器
-
bootstrap是有twitter开源的前端框架
-
haml官网是html的简写形式
-
enumerize 一般用于在model中一个字段中多个中选择一个
-
ransack是基于对象的搜索,TA也可以用与高级搜索,后台表格检索使用
Awesome Nested Set is an implementation of the nested set pattern for ActiveRecord models
friendly_id是为了更好的显示链接内容,这个需要在数据库设计字段,并且在cms中的permalink是使用friend_id
-
简单验证码
将系统配置放在以下的文件下 # config/settings.yml
- sidekiq 类似的还有Resque 和 Delayed_job
有时候一些任务的执行会很慢,而这些任务我们并不要求需要马上返回结果 (比如:发送邮件,生成图片缩略图),那我们可以选择将这些任务放到后台执行,以便于页面不会长时间等待执行。
-
en,轻量级Ruby web开发框架
-
Poseidon is a Kafka client. Kafka是一个大规模的分布式信息系统。具体信息见官网
-
exception_notification > The Exception Notification gem provides a set of notifiers for sending notifications when errors occur in > a Rack/Rails application.The built-in notifiers can deliver notifications by email, campfire rooms or via > webhooks.
这个用于上线系统,通过邮件接受系统错误信息
> Simple, but flexible HTTP client library, with support for multiple backends.
-
为动态内容建立标签
-
读取xls内容
> Track changes to your models' data. Good for auditing or versioning.
> Some [hopefully] useful extensions to Ruby’s String class. It is made up of three libraries: ActsAsUrl [permalink solution with better character translation], Unidecoder [Unicode to Ascii transliteration], and StringExtensions [miscellaneous helper methods for the String class].
-
为rails写api