then what can i use in the controller create method,
can u help me regarding this  plzz

On Oct 15, 1:13 pm, Frederick Cheung <[EMAIL PROTECTED]>
wrote:
> On Oct 15, 8:28 am, cool <[EMAIL PROTECTED]> wrote:
> g like
>
>
> ate
>
>
> >  def create
> >           puts params[:external_link][:title].inspect
> >       params[:external_link][:title].each_with_index do |l, i|
> >         ExternalLink.create!({:title => l, :url => params[:external_link]
> > [:url][i], :label => params[:label]})
> >       end
> >       redirect url(:external_links)
> >   end
>
> > in the model i have specified as
>
> > validates_presence_of :title, :url
>
> > the problem is when i submit the the form with out entering any
> > details its not checking validation
> > its giving error like
>
> > Validation failed: Title can't be blank, Url can't be blank
>
> If you use the ! variants of save, create, update_attributes etc...
> then validation failures raise an error instead of returning false.
>
> Fred
>
>
>
> > how can i do that in the controller and model
>
> > badly i need a help in this its urgent and imp.....
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to