View on GitHub

Toast Manual

Toast is a Rack application that hooks into Ruby on Rails. It exposes ActiveRecord models as a web service (REST API).

Version 1.0.*

Table of Contents - Directives

Global Configuration

For settings regarding all exposed models and behavior a global configuration file is located at config/toast-api.rb. It has following form and default values:

toast_settings {
  max_window 42
  link_unlink_via_post false

  authenticate do |request|
    false
  end
}

Settings

All settings are optional.

     authenticate do |request|
       ActionController::HttpAuthentication::Basic.authenticate(request) do |login,password|
         user = User.find_by_login login
         user.authenticate(password)
       end
     end