Adam C. Greenfield on 6 Feb 2006 19:51:20 -0000


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

Re: [PhillyOnRails] Simple Form Validation Example


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