Natural Resource

Logo

Natural Resource is a small but opinionated framework built ontop of some of our favourite gems. It is designed to speed up CRUD related activities whilst still maintaining sensible standards (e.g. Admin Panel, expandable principles for an API). It utilises Pundit for authorisation and Ransack for searching and filtering.

Sponsored by Terracoding

Getting Started

Simply install the gem

  gem 'natural_resource'

Setup the Base Policy:

rails g natural:install

Then generate controllers/policies as required:

rails g natural:resource controller_name optional_model_name

The overall codebase for NaturalResource is very small and the bulk of the functionality can be found in lib/natural_resource/controller.rb, it's all relatively simple ruby code designed to be expanded on top for any custom functionality. To understand how Pundit works I suggest visiting their repository and going through the basics.

Contributing

All contributions are welcome, simply fork the project and make a Pull Request upstream.

Testing

Simply run the rspec test suite from the spec/dummy folder.

License

Licensed under the MIT license, see the separate MIT-LICENSE.txt file.