Forme Demo Site

Overview

This is the demo site for Forme. Forme is a HTML forms library for ruby with the following goals:

  1. Have no external dependencies
  2. Have a simple API
  3. Support forms both with and without related objects
  4. Allow compiling down to different types of output

Note that as Forme is just an HTML forms library, the forms on this demo site are for display purposes only, you can't submit them.

Basic

These are basic model forms showing many field types and multiple association types. All pages in this section use the same template, with different options per page. The differences between some of these links are not visually obvious, you are encouraged to view the source of the page to see the markup differences.

Nested Associations

These show nested associations support.

Database Schema

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

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

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