Rails way admin interface to manage data
Clone or download
tian-im [Chore] HER and auto select (#133)
* make her optional

* rewrite auto_select

* refactor try_to

* continue updating docs

* rename field_helpers to fieldable

* update docs

* correct positions of @raise and @SInCE

* make rubocop happy

* don't need to do gem update system

* use latest ruby version

* make rubocop happy

* remove object_spaces metadata

* revert these files from master

* skip Style/RedundantBegin for utils

* exclude build of 2.3.8 and rails5.2
Latest commit 20baf37 Dec 29, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
bin init commit Jul 24, 2015
config
docs
gemfiles
lib
spec
.gitignore
.rubocop.yml [Chore] HER and auto select (#133) Dec 29, 2018
.ruby-version
.travis.yml
.yardopts
CHANGELOG.md
Gemfile
Gemfile.lock [Support] Rails 4.2 and specs (#131) Nov 9, 2018
MIT-LICENSE init commit Jul 24, 2015
README.md
Rakefile
wallaby.gemspec

README.md

Wallaby

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

Wallaby is a Rails engine for managing data. It can be easily and highly customized in a Rails way using decorators, controllers and views.

Below is animated screenshots of Wallaby:

Animated Demo

Here are examples of sophisticated customization:

  • Register your product on e-commence after product is created at controller level (see Controller for more):

    # app/controllers/admin/products_controller.rb
    class Admin::ProductsController < Admin::ApplicationController
      self.model_class = Product
    
      def create
        super do
          register_product_on_ecommence(resource) if resource.errors.blank?
        end
      end
    end
  • Customize to render the product markdown description (see Decorator for more):

    # app/decorators/product_decorators.rb
    class ProductDecorator < Admin::ApplicationDecorator
      self.show_fields[:description][:type] = 'markdown'
    end

    Then create the type partial accordingly (see Type Partial for more):

    <% # app/views/admin/products/show/_markdown.html.erb %>
    <% markdowner = Redcarpet::Markdown.new(Redcarpet::Render::HTML, {}) %>
    <%= raw markdowner.render(value) %>

Getting Started

  1. Add wallaby gem to Gemfile:

    # Gemfile
    gem 'wallaby'
  2. Mount engine in routes.rb:

    # config/routes.rb
    Rails.application.routes.draw do
      # ... other routes
      mount Wallaby::Engine => "/desired_path"
      # ... other routes
    end
  3. Start Rails server

  4. Open Wallaby on your local machine at http::/localhost:3000/desired_path. That's it.

If you are using authentication rather than Devise, you will need to configure authentication as Configuration - Authentication describes.

Want to contribute?

Raise an issue, discuss and resolve!

Testing

Make sure that postgres, mysql and sqlite are installed (checkout spec/dummy/config/database.yml to confirm settings). Then run the following command to setup database for test environment:

RAILS_ENV=test rake db:setup

Then start the tests:

rspec

License

This project rocks and uses MIT-LICENSE.