README.md in rack-queries-0.1.0 vs README.md in rack-queries-0.1.1
- old
+ new
@@ -1,9 +1,13 @@
# Rack::Queries
+[![Gem Version](https://img.shields.io/gem/v/rack-queries.svg)](https://github.com/CultureHQ/rack-queries)
+
This gem provides a page in your rack-based (e.g., `Rails`, `Sinatra`) application that allows quick execution of pre-built queries. The goal is to allow quick insights into the state of your application without needing to update the main UI. Consider it a backdoor admin page that you can use before you decide to truly expose query results.
+![Screenshot](docs/screenshot.png)
+
## Usage
First, add `rack-queries` to your Gemfile and `bundle install`. Then, mount the `Rack::Queries::App` application within your app.
Within Rails, that will look like (within `config/routes.rb`):
@@ -33,10 +37,10 @@
def org
Org.order(:name).pluck(:name)
end
def run(opts)
- Org.where(name: opts['name']).users.count
+ Org.where(name: opts['org']).users.count
end
end
```
Each public instance method is expected to return an array of options (they get transformed into `select` tags in the UI). They are then given to the `run` method through the `opts` hash which contains the value within a string key corresponding to the method name.