This is the demo site for AutoForme, an admin interface for ruby web applications which uses Forme to create the related forms.

This demo uses Roda as the web framework and Sequel::Model as the object-relational mapper. AutoForme also supports the Sinatra and Rails web frameworks.

This demo contains three examples of the same types of forms, each with slightly different options:

All three examples use the same database schema, created by this Sequel::Model code:

module AutoFormeDemo
  DB.create_table?(:artists) do
    primary_key :id
    String :name, null: false, unique: true
  end

  DB.create_table?(:albums) do
    primary_key :id
    String :name, null: false
    foreign_key :artist_id, :artists, null: false
    Date :release_date, null: false
    DateTime :release_party_time, null: false
    Integer :copies_sold, null: false, default: 0
    TrueClass :debut_album, null: false
    TrueClass :out_of_print
    index [:name, :artist_id], unique: true
  end

  DB.create_table?(:tracks) do
    primary_key :id
    Integer :number, null: false
    String :name, null: false
    foreign_key :album_id, :albums
    Float :length
  end

  DB.create_table?(:tags) do
    primary_key :id
    String :name, null: false, unique: true
  end

  DB.create_table?(:albums_tags) do
    foreign_key :album_id, :albums
    foreign_key :tag_id, :tags
    primary_key [:album_id, :tag_id]
  end
end

This demo site is part of the AutoForme repository, so if you want to know how it works, you can review the source.

In addition to the configuration options that are demonstrated in these three examples, because AutoForme is built on Forme, most of the Forme configuration options are available for configuring individual inputs, so you may be interested in the Forme demo site.

The demo site is editable by anyone that views it. So you can make changes to the data to see how things work. You can reset the data to the initial demo state if you want: