Jason Lenhart on 7 Feb 2006 01:34:06 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PhillyOnRails] Simple Form Validation Example


Thank you Adam ... I got it ... you found it :-)

I do not need a model class as ActiveRecord is what
the models use... I guess this is the Hibernate
equivalent in Rails.  I was not getting the lay of the
land in how this worked ... got it now.

Thank you for your help,

Jason

--- "Adam C. Greenfield" <adam.greenfield@gmail.com>
wrote:

> Forgive me if I am complete offbase about what you
> are asking. It is
> Monday morning :)
> 
> On 2/5/06, Jason Lenhart <jplenhart@yahoo.com>
> wrote:
> >
> > Note that my user model class is not going to a
> > database via scaffold - just a class in my models
> > directory.
> 
> So the class of "user" isn't an ActiveRecord model?
> How is the model
> class storing data?
> 
> >
> > When the form is submitted I cannot find a way to
> get
> > a handle on the populated user model object.  I
> dug
> > through my Rails book to no avail - did not see
> any
> > straightforward ways of doing this.
> >
> 
> In the controller action that your form is submitted
> to, you can
> access the value submitted as @params[:user]['name']
> 
> If you were populating populating an ActiveRecord
> model, you could
> call Class.new, so for example if your ActiveRecord
> model class was
> User, you could use something like:
> 
> @user = User.new(@params[:user])
> _______________________________________________
> talk mailing list
> talk@phillyonrails.org
> http://lists.phillyonrails.org/mailman/listinfo/talk
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
talk mailing list
talk@phillyonrails.org
http://lists.phillyonrails.org/mailman/listinfo/talk