Sha256: 9569c614b878b00b8251b04636d4e1f4a590ead8c6a31252a74f6faf3794c21e

Contents?: true

Size: 1.41 KB

Versions: 6

Compression:

Stored size: 1.41 KB

Contents

# aureus

**a framework for rails admin interfaces**

Aureus is a tool to quickly generate admin interfaces for a rails app.
It's between scaffolding and tools like ActiveAdmin.

## Sample Controller

The following Controller will render a finished interface:

```ruby
class ResourcesController < Aureus::ResourcesController
  before_filter :prepare_aureus

  def index
    @resources = Resource.all
  end

  def new
    @resource = Resource.new
  end

  def create
    Resource.create!(permitted_params[:resource])
    redirect_to resources_url
  end

  def show
    @resource = Resource.find(params[:id])
  end

  def edit
    @resource = Resource.find(params[:id])
  end

  def update
    resource = Resource.find(params[:id])
    resource.update!(permitted_params[:resource])
    redirect_to resource_url(resource)
  end

  def destroy
    resource = Resource.find(params[:id])
    resource.destroy!
    redirect_to resources_url
  end

  protected

  def prepare_aureus
    aureus({
      actions: [:index, :new, :create, :show, :edit, :update, :destroy],
      table_fields: [:id, :title, :text],
      form_fields: [:title, :text],
      item_fields: [:title, :text]
    })
  end

  def permitted_params
    params.permit(resource: [:title, :text])
  end
end
```

## Generators

The following generators are available:

* Run `rails g aureus:setup` to create the initializer.
* Run `rails g aureus:copy` to copy the views and layout.

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
aureus-3.0.5 README.md
aureus-3.0.4 README.md
aureus-3.0.3 README.md
aureus-3.0.2 README.md
aureus-3.0.1 README.md
aureus-3.0.0 README.md