This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Thu May 01 00:32:31 -0700 2008 | |
| |
CHANGELOG | Tue Apr 29 15:16:36 -0700 2008 | |
| |
README | Fri Aug 14 07:53:26 -0700 2009 | |
| |
Rakefile | Tue Apr 29 15:16:36 -0700 2008 | |
| |
activerecord-tableless-models.gemspec | Fri Aug 14 07:53:26 -0700 2009 | |
| |
init.rb | Tue Apr 29 15:16:36 -0700 2008 | |
| |
lib/ | Mon Aug 03 11:40:29 -0700 2009 |
README
ActiveRecord Tableless Models ----------------------------- <DEPRECATED_NOTICE> This library is no longer maintained and not recommended for general use. With Rails 3.0 on the way, and the new ActiveModel::Validations mixin, the library becomes worthless. Until Rails 3.0 is released you might want to consider looking at the excellent Validator [1] gem from Jay Fields that provides the same functionality (in terms of validations) but doesn't require ActiveRecord at all. I've updated the gemspec so that this gem will not work with ActiveRecord 3.0 or later. 1 - http://validatable.rubyforge.org/ This was my first gem ever, so it will be surely missed. </DEPRECATED_NOTICE> A single implementation of the ActiveRecord Tableless Model pattern for any Rails project or other Ruby project that uses ActiveRecord. Define a model like this: class ContactMessage < ActiveRecord::Base has_no_table column :name, :string column :email, :string validates_presence_of :name, :email end You can now use the model in a view like this: <%= form_for :message, @message do |f| %> Your name: <%= f.text_field :name %> Your email: <%= f.text_field :email %> <% end %> And in the controller: def message @message = ContactMessage.new if request.post? @message.attributes = params[:message] if @message.valid? # Process the message... end end end







