Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Social Networking website

I've been doing the social networking project recently, but I'm curious to how there would be a search engine to search for friends instead of looking on your friends list, and how there could be a chat/messaging feature. If you could add tutorials on how to add these two features onto a social networking website, that would be awesome! Thanks!

Searching should be pretty simple. Pull the names of your friends into an array presumably called 'friends'. Then do something like

//pretending that we're searching for 'sam' arr.select { |s| s.include? 'sam' }

and that will return ['sam']

or multiple sames whichever. Then you can just loop through that array and display whatever info you want just like you would in the 'statuses' tutorial on the rails application. A chat application is a little more complicated. I'd recommend reading about how to integrate socket.io and node.js into your website. Hope that helps!

--Carl

1 Answer

Thanks for your answer Carl!

Your welcome Mister Late