Plugins - Validates Multiparameter Assignments

StarAdd to favorites

This plugin adds "validates_multiparameter_assignments" method to ActiveRecord::Base. Example:

  class User < ActiveRecord::Base
    validates_multiparameter_assignments
  end

This makes multiparameter assignment errors to be added to the model, rather than raising ActiveRecord::MultiparameterAssignmentErrors. By default the error message is read from ActiveRecord::Base.default_error_messages[:invalid]. You can change the message by adding an option like this:

  validates_multiparameter_assignments :message => " is not entered correctly."

This plugin is especially useful when you use date_select helper method in the view, where the user can enter invalid dates such as "Feb 31, 2006".

Download

http://www.kbmj.com/~shinya/rails/validates_multiparameter_assignments-1.0.zip

  • Currently 4.4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Misc. Enhancements

Tags

Comments

Add a comment
Rudie 24 Jan 2008

Isn't there any solution to the problem I have when using the Date class and the Datehelper#date_select which gives me also all the invalid dates like 31 februari? I think a plugin that gives me an error message on selecting the invalid date is not the root of the problem and isn't sufficient for a fundamental error like this!

Please, anyone have a solution?

anon 28 Jun 2006

the url is not parsing correctly

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?