Sha256: 6141b326a8c87d9138e52ad54ee2cb71fce91a6acf45be816e1e62b94b5ae725

Contents?: true

Size: 1.98 KB

Versions: 8

Compression:

Stored size: 1.98 KB

Contents

# Models

This is an example of a **Typus** enabled model with all available
options. You can use this example to customize your YAML files which
only have set the most common settings.

    Post:
      fields:
        default: id, title, category_id, created_at, is_published?
        list: id, title, category_id, created_at, is_published?
        form: title, body, is_published?, created_at
        show: title, category, is_published?
        relationship: title, status
        options:
          auto_generated:
          booleans:
            is_published: ["Yes, it is", "No, it isn't"]
          date_formats:
            created_at: post_long
          selectors:
          read_only:
          filter_by_date_range: valid_until
          templates:
            body: rich_text
      actions:
        index: cleanup
        edit: send_as_newsletter
        show: rebuild
      export: csv, xml, pdf
      order_by: created_at
      relationships:
      filters: is_published?, created_at, category_id
      search: title, body
      application: Application
      description: Some text to describe the model
      options:
        default_action_on_item: show
        end_year: 2015
        form_rows: 25
        action_after_save: :index
        minute_step: 15
        nil: 'nil'
        only_user_items: true
        per_page: 5
        start_year: 1990

Note: To define namespace models use :: as a separator. (i.e. Delayed::Job)

# Roles

In this file you can configure the actions available for each of
your models on the application. You can also use the 'all' shortcut
to allow the user the access to all actions.

    admin:
      Post: create, read, update, delete
      Category: create, read, update, delete
      TypusUser: all

    editor:
      Post: create, read, update
      Category: read, update

You can also define `resources` which are not related to a model,
for example to control MemCached or see the Starling queue
statistics.

    admin:
      Starling: index
      MemCached: index, cleanup

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
typus-1.0.0.pre8 lib/generators/templates/config/typus/README
typus-1.0.0.pre7 lib/generators/templates/config/typus/README
typus-1.0.0.pre6 lib/generators/templates/config/typus/README
typus-1.0.0.pre5 lib/generators/templates/config/typus/README
typus-1.0.0.pre4 lib/generators/templates/config/typus/README
typus-1.0.0.pre3 lib/generators/templates/config/typus/README
typus-1.0.0.pre2 lib/generators/templates/config/typus/README
typus-1.0.0.pre lib/generators/templates/config/typus/README