views:

192

answers:

1

Hey guys, I'm new to Ruby and I've been playing around with making some webapps with it and I find it totally awesome. I just recently configured Authlogic to perform authentication within my app and next I would like to create a table that stores user profile information such as address, zip, phone, etc. and then later display some of that info in a table. Sort of like a social networking app.

I'm wondering whats the next step though. Should I create a separate Model/Controller and View for the profile? or Should I somehow add the profile tables and controller logic to the AuthLogic User model/controller.

And How do I display a datagrid? (sorry, .net user trying to convert) of all the other user profiles on a page... I'm just having a hard time trying to figure out how to display a table of all this relational data.... Any tips, links, tutorials, suggestions would be greatly appreciated....Thanks Yall.

A: 

Yes, I have always achieved this by creating a Profile resource and just sticking everything to do with the profile in there. User has Profile, Profile belongs to User.....

There's a great book called Rails Space (been out for a few years so it's now a little redundant which talks you through this kind of thing.

Chapter 9 is the one you want so if they have it in your local library or eBookShop then you can try getting it from there...

Failing that, you can always just download the source code (for FREE) and backwards engineer from there

A warning regarding the book, it was written in the days before we had REST so you might need to hack it up a tiny bit - but you can always find Rails 2.0 version of the source code..... it's on the railspace website I believe (http://railsspace.com)

Good luck

stephenmurdoch
PS - you can get a copy of the book here: http://my.safaribooksonline.com/9780321480798 - you can sign up for the free trial which entitles you to 1 free chapter (select chapter 9) - You will be asked for credit card details when you sign up but you can just cancel the subscription before they take any cash from you after the trial is over... assuming of course that you do not wish to pay the membership fee
stephenmurdoch