Gem 虽然我很菜,但也尝试去写了一个 gem

ad583255925 · 2018年03月06日 · 最后由 ad583255925 回复于 2018年03月06日 · 1454 次阅读

这个 Gem 叫做little_sql_client,可以为你的 Rails 项目添加一个在线 SQL 查询

项目地址:https://github.com/jiyarong/little_sql_client

Installation

Add this line to your application's Gemfile:

gem 'little_sql_client'

And then execute:

$ bundle

Or install it yourself as:

$ gem install little_sql_client

Contributing

$ rails g little_sql_client:install

in config/initializer/little_sql_client.rb

# setup your safe ip in production mode
LittleSqlClient::Config.ip_white_list = [
    # '127.0.0.1'
]

to setup your safe ip

in routes.rb

Rails.application.routes.draw do
  mount LittleSqlClient::Engine => "/sql_records"
end

and then open url "your_project_host/sql_records"

多写写就成为老鸟了

huacnlee 回复

多谢大佬,话说这个项目就是借鉴了你的https://github.com/rails-engine/exception-track

需要 登录 后方可回复, 如果你还没有账号请 注册新账号