Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
app
 
 
bin
 
 
 
 
 
 
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Wallaby

Gem Version License: MIT Travis CI Maintainability Test Coverage Inch CI

Wallaby is a Rails engine that autocompletes the resourceful controller and view for a given ORM model (ActiveRecord, HER) for admin interface and other purposes.

It can be extended to support any ORM model and can be easily and deeply customized at MVC's different aspects by using decorators, controllers, type partials, servicers, authorizers, paginators and themes.

Try the demo here.

Animated Demo

Install

Add Wallaby to Gemfile.

# Gemfile
gem 'wallaby'

And re-bundle.

bundle install

Basic Usage

As Admin Interface

Just mount Wallaby engine to desired path, e.g. /admin in config/routes.rb.

# config/routes.rb
mount Wallaby::Engine, at: '/admin'

Or run installer to generate default application classes/templates under namespace e.g. Admin and mount Wallaby engine to path /admin.

rails g wallaby:install admin

Restart rails server, and visit http://localhost:3000/admin to start exploring!

For General Purposes

Instead of using Rails scaffold generator to generate all the boilerplate code, Wallaby can help to quickly get the pages up for ordinary resourceful actions.

For example, if a model Blog is generated:

rails generate model blog title:string body:text
rails db:migrate

There are two ways to spin up things, choose what fits best:

  • add resources route to config/routes.rb using wresources helper without any needs of customization

    # config/routes.rb
    wresources :blogs, controller: 'wallaby/resources'
  • add blogs controller for later customization

    # app/controllers/blogs_controller.rb
    class BlogsController < Wallaby::ResourcesController
    end

    then add corresponding resources route using origin Rails resources helper

    # config/routes.rb
    resources :blogs
    

Restart rails server, and visit http://localhost:3000/blogs to give it a taste!

Documentation

Want to contribute?

Raise an issue, discuss and resolve!

License

This project uses MIT License.

About

Autocomplete the resourceful actions and views for ORMs for admin interface and other purposes.

Topics

Resources

License

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •