How should I go about creating a profile page or information text field on a rails app?
I had just recently completed a mockup version of Twitter and would like to implement a profile section where each user can describe themselves in text. This section should appear on their profile page and the user index page as well so that a user searching or browsing user accounts would be able to narrow down their search through reading this profile page, thus allowing one to know who to follow based on interested.
开发者_C百科How can I have rails save and store this information?
Here I have an example of a text box and how it would look if it were in place. It doesn't necessarily need to follow this exact format, anything will do really.
Above is the users index page where I would like the information to be display on the right hand side of each user. It would be nice if this information type up would be searchable so that a user would know who to follow. Thanks in advance!
I think it really depends on how you want to handle the "profile information" that you want to add. Like the guy above me, those tutorials are important and very helpful.
You can create a separate "info" model that contains a single string and belongs to a single user, and implement info like that... or you could simply add a string attribute to your User model, and have them update that attribute whenever the profile info gets changed.
Are you looking for an idea on "how" to do it, or actual code
精彩评论