How-to: one form, two submit button, two validates-presence_of

Hi, everybody;

The following question blocked my way for a couple days. I appreciate
any help in advance.

I have one form that adds text entry to the database. There are two
ways to add the entry:

1. User fills all the fields then click "submit button 1" -- need to
validates_presence_of "field-1" and "field-2"

2. User click "submit button 2" -- need to validates_presence_of
"field-2" and "field-5". ("field-5" contains a URL and server will
search in the internet and fill all other fields automatically)

How to implement the validations?

Thanks again

I have tried the :if option but how to pass the button name to the
model? I used params[:create], it doesn't work

here are the several ways I tried in model class:

1. validates_presence_of :label, :tag, :if =>params[:create] ==
       validates_presence_of :label, :url, :if =>params[:create] ==
"Get text and save"
   (it seems that model does not recognize the params[])

2. validates_presence_of :label, :tag, if => create == "Create"
       validates_presence_of :label, :url, :if => create == "Get text
and save"
   (no run-time error, but the validation result is not correct)

3. validates_presence_of :label, :tag, if => :create == "Create"
       validates_presence_of :label, :url, :if => :create == "Get text
and save"
     (same as 2)

The "create" is the submit button name and it is not related with the

I have also written a method in model class, with the
validates_presence_of in it, then called from the controller. But the
error is that "validates_presence_of" is not a method. it is very