Hi Everyone,

First post from a rails newbie, so please excuse me for asking really basic 
questions.

I've been working on a loot management system for EverQuest 2 (my first rails 
app), and have become stuck on a validation issue.  I have a "Drop" model that 
will be populated via http post from a log parsing plugin written in c#.

I built a custom validator for it, but don't want it called from create or 
update. Instead, I want the validation called on a custom action called 
"allocate_loot". And if the validation fails, I'd like to redirect to the edit 
path for the drop and show the standard scaffolded error messages.

I was hoping "validates_with DropValidator, :on => :allocate_loot" would work, 
but that only seems to work with :create and :update.

I could potentially override validate in validations.rb, but that seems like 
massive overkill for a little bit of readability in my model.

What's a "nice" way to do this?

Cheers,

Craig

P.S. App is in Ruby 1.8.7 / Rails 3.0.3

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en.

Reply via email to