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

Saving images to the database and displaying on the page

I am still a newbie to Ruby on Rails, I am developing an application where the user needs to upload and saves it. The application needs to be able to store that image in the database and later displays it on the webpage to the user.

How do I solve this in Rails?

Kind Regards,

5 Answers

Naomi Freeman
STAFF
Naomi Freeman
Treehouse Guest Teacher

If you want to use a gem in rails, you can use paperclip :)

See the "Uploading files" module. Know that it is in rails 3, but the pre-paperclip installation information is valuable http://teamtreehouse.com/library/advanced-social-features-in-ruby-on-rails

The updated paperclip information can be found with the gem's github page: https://github.com/thoughtbot/paperclip

Marcus Tisäter
Marcus Tisäter
4,886 Points

if you want to build it in ruby look at Sinatra, datamapper and SQLiteManager

Thanks for your response Marcus, I will check them out.

Thanks Naomi, that was helpful!