github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

nesquena / active_form

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 27
    • 2
  • Source
  • Commits
  • Network (2)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Submission to github of validation plugin for non-activerecord models. — Read more

  cancel

http://www.realityforge.org/svn/code/active-form/trunk/

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

added ignore for svn 
nesquena (author)
Wed Apr 16 22:15:21 -0700 2008
commit  fd33ef09bd7557fd42f01937f504ec25576bcda2
tree    709a363b3c81a88d203b47a2a5bfb65ac1e2088f
parent  add3c23d77198308525f66a0f3470fb571fe66c4
active_form /
name age
history
message
file .gitignore Wed Apr 16 22:15:21 -0700 2008 added ignore for svn [nesquena]
file MIT-LICENSE Wed Apr 16 22:09:18 -0700 2008 created repository [nesquena]
file README.txt Wed Apr 16 22:09:18 -0700 2008 created repository [nesquena]
file init.rb Wed Apr 16 22:09:18 -0700 2008 created repository [nesquena]
directory lib/ Wed Apr 16 22:11:25 -0700 2008 removed svn dir [nesquena]
README.txt
= active-form plugin for Rails

active-form is a plugin that makes it easy to have model objects that support the 
ActiveRecord Validations but are not backed by database tables. The plugin is designed
to make it possible to use the ActiveForm derived classes in a very similar manner to
the ActiveRecord::Base derived objects.

Originally described at;

http://www.realityforge.org/articles/2005/12/02/validations-for-non-activerecord-model-objects

== How To Define An ActiveForm Object

class Search < ActiveForm
  attr_accessor :text
  validates_length_of :text, :maximum=>30
end

== How To Use ActiveForm Object In Controller

class NavigatorController < ApplicationController
  def search
    @search = Search.new(params[:search])
    if @search.valid?
      ...do search here...
    end
  end
end

== How To Use ActiveForm Object In View

<%= start_form_tag(:action => 'search') %>
<%= error_messages_for('search') %>
<%= text_field('search', 'text', {"maxlength" => 30}) %>
<button type="submit">Save</button>
<%= end_form_tag %>

== Details

License: Released under the MIT license.
Latest Version: http://www.realityforge.org/svn/public/code/active-form/trunk/

== Credits

Peter Donald <peter at realityforge dot org>.
Dae San Hwang for fix to work with Rails 1.1.
Trevor Squires for suggestion to use Reloadable::Subclasses rather than dispatcher hack for Rails 1.1.
Tim Lucas for patch to allow bulk addition of attributes.
Geoff Schmidt for adding support for Callbacks.
Sean Christman for attributes getter.
Jack Christensen for attributes setter.
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server