What is Rails way to save images?

Posted by user on Programmers See other posts from Programmers or by user
Published on 2013-09-28T19:45:23Z Indexed on 2013/11/03 10:14 UTC
Read the original article Hit count: 176

Filed under:
|
|

I develop on iOS, and I'm switching from a PHP backend to Ruby on Rails. The interchange format is JSON.

A quick Google search for 'save images in Rails' has nearly every result talking about saving image data as blobs to the database. I might be mistaken, but I'm under the impression that saving image data in a database is a huge waste of time and space (as opposed to saving a link to the file location ('/img/subcat/4656.png').

In PHP, it's pretty standard to receive the data, generate a filename, then save that file to disk, and then update the database with the image's location on disk. Is this the same for Rails, or is there some built-in ActiveRecord image functionality I'm not aware of?

© Programmers or respective owner

Related posts about ruby-on-rails

Related posts about persistence