开发者

Add Profile Information to Authlogic in in Ruby on Rails

I'm new to Ruby and I've been playing around with making some webapps with it and I find it totally awe开发者_C百科some. 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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜