{"id":21118,"date":"2012-04-09T12:24:04","date_gmt":"2012-04-09T12:24:04","guid":{"rendered":"http:\/\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary"},"modified":"2025-03-30T01:51:42","modified_gmt":"2025-03-30T08:51:42","slug":"ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary","status":"publish","type":"post","link":"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary","title":{"rendered":"Ruby on Rails File uploads With CarrierWave and Cloudinary"},"content":{"rendered":"<p><span id=\"internal-source-marker_0.6963136298581958\"><span style=\"background-color: transparent; vertical-align: baseline;\"><span style=\"font-family: Arial;\"><span style=\"font-size: 15px;\">When we set to develop Cloudinary\u2019s Rails integration Gem, it was obvious to us that we\u2019ll base it on <strong>CarrierWave<\/strong>. Here\u2019s why. <\/span><\/span><\/span><\/span><\/p>\n<p><span id=\"internal-source-marker_0.6963136298581958\"><span style=\"background-color: transparent; vertical-align: baseline;\"><span style=\"font-family: Arial;\"><span style=\"font-size: 15px;\">Photos are a major part of your website. Your eCommerce solution will have multiple snapshots uploaded for each product. Your users might want to <a title=\"File Upload\" href=\"https:\/\/cloudinary.com\/features\/file_upload_storage\" target=\"_blank\" rel=\"noopener\">upload<\/a> their photo to be used as their personal profile photo. <\/span><\/span><\/span><\/span><\/p>\n<h2>What You Need<\/h2>\n<p><span id=\"internal-source-marker_0.6963136298581958\"><span style=\"background-color: transparent; vertical-align: baseline;\"><span style=\"font-family: Arial;\"><span style=\"font-size: 15px;\">What\u2019s entailed when developing such a photo management pipeline, end-to-end?<\/span><\/span><\/span><\/span><\/p>\n<p><span style=\"font-family: Arial;\"><span style=\"font-size: 15px;\">\u00a0<\/span><\/span><\/p>\n<ul style=\"font-size: 15px;\">\n<li><span style=\"font-family: Arial;\"><span style=\"background-color: transparent;\">You\u2019ll need an HTML file upload form.<\/span><\/span><\/li>\n<li><span style=\"background-color: transparent; font-family: Arial;\">The server will need to manage the reception and processing of the uploaded image files.<\/span><\/li>\n<li><span style=\"font-family: Arial;\"><span style=\"background-color: transparent;\">Uploaded images should be stored on a safe storage with access for multiple application servers.<\/span><\/span><\/li>\n<li><span style=\"font-family: Arial;\"><span style=\"background-color: transparent;\">Model entities should keep references to uploaded images.<\/span><\/span><\/li>\n<li><span style=\"font-family: Arial;\"><span style=\"background-color: transparent;\">Uploaded images will need to be resized and cropped into different dimensions matching the graphics design of your web site.<\/span><\/span><\/li>\n<li><span style=\"font-family: Arial;\"><span style=\"background-color: transparent;\">The server will need to find and deliver the resized images to visitors of your site when displaying a page with the relevant model entity (e.g., display a thumbnail of the profile picture in a user profile page, etc.).<\/span><\/span><\/li>\n<li><span style=\"font-family: Arial;\"><span style=\"background-color: transparent;\">Allow overriding uploaded images with new ones when needed.<\/span><\/span><\/li>\n<\/ul>\n<div><\/div>\n<h2>How Does It Work?<\/h2>\n<div><\/div>\n<div><span style=\"font-family: Arial;\"><span style=\"font-size: 15px;\">Cloudinary allows you to overcome this complexity in its entirety, but how does it work?<\/span><\/span><\/div>\n<div><span style=\"font-family: Arial;\"><span style=\"font-size: 15px;\">\u00a0<\/span><\/span><\/div>\n<p>Over the years, we\u2019ve had the pleasure of using some of RoR\u2019s many excellent <a href=\"https:\/\/cloudinary.com\/features\/file_upload_storage\" target=\"_blank\" rel=\"noopener\">file upload<\/a> solutions:\u00a0<a href=\"https:\/\/github.com\/jnicklas\/carrierwave\" target=\"_blank\" rel=\"noopener\">CarrierWave<\/a>, <a href=\"https:\/\/github.com\/thoughtbot\/paperclip\" target=\"_blank\" rel=\"noopener\">Paperclip<\/a>, <a href=\"https:\/\/github.com\/markevans\/dragonfly\" target=\"_blank\" rel=\"noopener\">Dragonfly<\/a>, <a href=\"https:\/\/github.com\/technoweenie\/attachment_fu\" target=\"_blank\" rel=\"noopener\">attachment_fu<\/a> and others. All-in-all, CarrierWave often proved a better fit for our needs:<\/p>\n<div>\n<div>\n<ul>\n<li>Simple Model entity integration. Adding a single string \u2018image\u2019 attribute for referencing the uploaded image.<\/li>\n<li>&#8220;Magic&#8221; model methods for uploading and remotely fetching images.<\/li>\n<li>HTML file upload integration using a standard file tag and another hidden tag for maintaining the already uploaded &#8220;cached&#8221; version.<\/li>\n<li>Straight-forward interface for creating derived image versions with different dimensions and formats. Image processing tools are nicely hidden behind the scenes.<\/li>\n<li>Model methods for getting the public URLs of the images and their resized versions for HTML embedding.<\/li>\n<li>Many others &#8211; see CarrierWave <a href=\"https:\/\/github.com\/jnicklas\/carrierwave\" target=\"_blank\" rel=\"noopener\">documentation page<\/a>.<\/li>\n<\/ul>\n<div>\n<div><\/div>\n<div>What we liked most is the fact the CarrierWave is very modular. You can easily switch your storage engine between a local file system, Cloud-based <strong>AWS S3<\/strong>, and more. You can switch the image processing module between <strong>RMagick<\/strong>, <strong>MiniMagick<\/strong> and other tools. You can also use local file system in your dev env and switch to S3 storage in the production system.<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div><\/div>\n<h2>Cloudinary and Rails Integration<\/h2>\n<div>\n<div>\n<div><\/div>\n<div>\n<div>When we developed Cloudinary and decided to provide a <strong>Ruby GEM<\/strong> for simple Rails integration, it was obvious that we\u2019ll want to build on CarrierWave. Our users can still enjoy all benefits of CarrierWave mentioned above, but also enjoy the additional benefits that Cloudinary provides:<\/div>\n<\/div>\n<\/div>\n<\/div>\n<ul>\n<li><strong>The storage engine is Cloudinary.<\/strong> All images uploaded through CarrierWave model methods are directly uploaded and stored in the cloud.<\/li>\n<li><strong>All resized versions and image transformations are done in the cloud by Cloudinary:<\/strong>\n<ul>\n<li>No need to install any image processing tools or Ruby GEMs.<\/li>\n<li>You can create the resized versions eagerly while uploading or lazily when users accesses the actual images. Save processing time and storage.<\/li>\n<li>Change your desired image versions at any time and Cloudinary will just create them on the fly, no need to batch update all your images when the graphics design of your site changes.<\/li>\n<\/ul>\n<\/li>\n<li><strong>All public image URLs returned by CarrierWave are Cloudinary URLs.<\/strong> This means they are automatically delivered through a global CDN with smart caching. Seamlessly enhancing the performance of your web application.<\/li>\n<\/ul>\n<p>Some code samples:<\/p>\n<div class=\"code-holder\">\n<div>\n<div class=\"highlight\">\n<pre><span class=\"k\">class<\/span> <span class=\"nc\">PictureUploader<\/span> <span class=\"o\">&lt;<\/span> <span class=\"no\">CarrierWave<\/span><span class=\"o\">::<\/span><span class=\"no\">Uploader<\/span><span class=\"o\">::<\/span><span class=\"no\">Base<\/span>\n\n  <span class=\"kp\">include<\/span> <span class=\"no\">Cloudinary<\/span><span class=\"o\">::<\/span><span class=\"no\">CarrierWave<\/span>\n  \n  <span class=\"n\">version<\/span> <span class=\"ss\">:standard<\/span> <span class=\"k\">do<\/span>\n    <span class=\"n\">process<\/span> <span class=\"ss\">:resize_to_fill<\/span> <span class=\"o\">=&gt;<\/span> <span class=\"o\">[<\/span><span class=\"mi\">100<\/span><span class=\"p\">,<\/span> <span class=\"mi\">150<\/span><span class=\"p\">,<\/span> <span class=\"ss\">:north<\/span><span class=\"o\">]<\/span>\n  <span class=\"k\">end<\/span>\n  \n  <span class=\"n\">version<\/span> <span class=\"ss\">:thumbnail<\/span> <span class=\"k\">do<\/span>\n    <span class=\"n\">process<\/span> <span class=\"ss\">:resize_to_fit<\/span> <span class=\"o\">=&gt;<\/span> <span class=\"o\">[<\/span><span class=\"mi\">50<\/span><span class=\"p\">,<\/span> <span class=\"mi\">50<\/span><span class=\"o\">]<\/span>\n  <span class=\"k\">end<\/span>     \n    \n<span class=\"k\">end<\/span>\n<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"code-holder\">\n<div>\n<div class=\"highlight\">\n<pre><span class=\"k\">class<\/span> <span class=\"nc\">Post<\/span> <span class=\"o\">&lt;<\/span> <span class=\"no\">ActiveRecord<\/span><span class=\"o\">::<\/span><span class=\"no\">Base<\/span>\n  <span class=\"o\">.<\/span><span class=\"n\">.<\/span><span class=\"o\">.<\/span>\n  <span class=\"n\">mount_uploader<\/span> <span class=\"ss\">:picture<\/span><span class=\"p\">,<\/span> <span class=\"no\">PictureUploader<\/span>\n  <span class=\"o\">.<\/span><span class=\"n\">.<\/span><span class=\"o\">.<\/span>\n<span class=\"k\">end<\/span>\n<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"code-holder\">\n<div>\n<div class=\"highlight\">\n<pre><span class=\"o\">=<\/span> <span class=\"n\">form_for<\/span><span class=\"p\">(<\/span><span class=\"ss\">:post<\/span><span class=\"p\">)<\/span> <span class=\"k\">do<\/span> <span class=\"o\">|<\/span><span class=\"n\">post_form<\/span><span class=\"o\">|<\/span>\n  <span class=\"o\">=<\/span> <span class=\"n\">post_form<\/span><span class=\"o\">.<\/span><span class=\"n\">hidden_field<\/span><span class=\"p\">(<\/span><span class=\"ss\">:picture_cache<\/span><span class=\"p\">)<\/span>\n  <span class=\"o\">=<\/span> <span class=\"n\">post_form<\/span><span class=\"o\">.<\/span><span class=\"n\">file_field<\/span><span class=\"p\">(<\/span><span class=\"ss\">:picture<\/span><span class=\"p\">)<\/span>\n<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"code-holder\">\n<div>\n<div class=\"highlight\">\n<pre><span class=\"n\">= image_tag<\/span><span class=\"p\">(<\/span><span class=\"n\">post<\/span><span class=\"o\">.<\/span><span class=\"n\">picture_url<\/span><span class=\"p\">,<\/span> <span class=\"ss\">:alt<\/span> <span class=\"o\">=&gt;<\/span> <span class=\"n\">post<\/span><span class=\"o\">.<\/span><span class=\"n\">short_name<\/span><span class=\"p\">)<\/span>\n\n<span class=\"n\">= image_tag<\/span><span class=\"p\">(<\/span><span class=\"n\">post<\/span><span class=\"o\">.<\/span><span class=\"n\">picture_url<\/span><span class=\"p\">(<\/span><span class=\"ss\">:thumbnail<\/span><span class=\"p\">),<\/span> <span class=\"ss\">:width<\/span> <span class=\"o\">=&gt;<\/span> <span class=\"mi\">50<\/span><span class=\"p\">,<\/span> <span class=\"ss\">:height<\/span> <span class=\"o\">=&gt;<\/span> <span class=\"mi\">50<\/span><span class=\"p\">)<\/span>\n<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p>We believe that for Ruby on Rails developers, the combination of Cloudinary with its CarrierWave-based gem, delivers a complete image management solution, with excellent model binding.<\/p>\n<p>More details about about our CarrierWave plugin are available in our documentation: <a href=\"https:\/\/cloudinary.com\/documentation\/rails_integration#carrierwave_upload\">https:\/\/cloudinary.com\/documentation\/rails_integration#carrierwave_upload<\/a><\/p>\n<p>What do you think about our\u00a0ruby on rails file upload solution? Any suggestions or improvement ideas?<\/p>\n<p>UPDATE: We&#8217;ve published <a href=\"https:\/\/cloudinary.com\/blog\/advanced_image_transformations_in_the_cloud_with_carrierwave_cloudinary\">another post<\/a> about additional advanced image transformations in the cloud with CarrierWave &amp; Cloudinary.<\/p>\n<h2>Resources<\/h2>\n<ul>\n<li><span style=\"font-family: Arial; font-size: 11pt;\"><a title=\"File Upload\" href=\"https:\/\/cloudinary.com\/blog\/automating_file_upload_and_sharing\" target=\"_blank\" rel=\"noopener\">File upload and storage<\/a> with Cloudinary<\/span><\/li>\n<li><span style=\"font-family: Arial; font-size: 11pt;\"><span style=\"font-family: Arial;\"><a title=\"Image upload\" href=\"https:\/\/cloudinary.com\/documentation\/upload_images\" target=\"_blank\" rel=\"noopener\">Image Upload<\/a> &#8211; Image Management for Developers<\/span><\/span><\/li>\n<li><a title=\"Upload Widget\" href=\"https:\/\/cloudinary.com\/documentation\/upload_widget\" target=\"_blank\" rel=\"noopener\"><span style=\"font-family: Arial; font-size: 11pt;\"><span style=\"font-family: Arial;\"><span style=\"font-family: Arial;\">Cloudinary&#8217;s upload widget<\/span><\/span><\/span><\/a><\/li>\n<li><a title=\"PHP File upload\" href=\"https:\/\/cloudinary.com\/blog\/file_upload_with_php\" target=\"_blank\" rel=\"noopener\">PHP file upload<\/a> with Cloudinary<\/li>\n<li><span style=\"font-family: Arial; font-size: 11pt;\"><a title=\"AJAX File upload\" href=\"https:\/\/cloudinary.com\/blog\/file_upload_with_ajax\" target=\"_blank\" rel=\"noopener\">AJAX file upload<\/a> &#8211; Quick tutorial &amp; time saving Tips<\/span><\/li>\n<li><a title=\"Android file upload\" href=\"https:\/\/cloudinary.com\/blog\/impressed_by_whatsapp_technology_build_a_whatsapp_clone_with_image_and_video_upload\" target=\"_blank\" rel=\"noopener\">Android file upload<\/a>&#8211; Clone WhatsApp technology using Cloudinary<\/li>\n<li><a title=\"Photo sharing website\" href=\"https:\/\/cloudinary.com\/blog\/how_to_build_a_real_time_photo_sharing_website_in_a_few_easy_steps\" target=\"_blank\" rel=\"noopener\">Build a real-time photo sharing website<\/a> in a few easy steps<\/li>\n<li><a title=\"jQuery image upload\" href=\"https:\/\/cloudinary.com\/blog\/direct_image_uploads_from_the_browser_to_the_cloud_with_jquery\" target=\"_blank\" rel=\"noopener\">jQuery image upload<\/a> plugin<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>When we set to develop Cloudinary\u2019s Rails integration Gem, it was obvious to us that we\u2019ll base it on CarrierWave. Here\u2019s why. Photos are a major part of your website. Your eCommerce solution will have multiple snapshots uploaded for each product. Your users might want to upload their photo to be used as their personal [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":23380,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_cloudinary_featured_overwrite":false,"footnotes":""},"categories":[1],"tags":[119,257],"class_list":["post-21118","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-file-upload","tag-ruby-on-rails"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.6 (Yoast SEO v26.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Ruby on Rails File Uploads Using CarrierWave Gem<\/title>\n<meta name=\"description\" content=\"Leverage the combination of Cloudinary with its CarrierWave-based gem to upload and manage image files with excellent model binding.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ruby on Rails File uploads With CarrierWave and Cloudinary\" \/>\n<meta property=\"og:description\" content=\"Leverage the combination of Cloudinary with its CarrierWave-based gem to upload and manage image files with excellent model binding.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary\" \/>\n<meta property=\"og:site_name\" content=\"Cloudinary Blog\" \/>\n<meta property=\"article:published_time\" content=\"2012-04-09T12:24:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-30T08:51:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1647045705\/47_ruby_uploads\/47_ruby_uploads-jpg?_i=AA\" \/>\n\t<meta property=\"og:image:width\" content=\"2000\" \/>\n\t<meta property=\"og:image:height\" content=\"1100\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"NewsArticle\",\"@id\":\"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary#article\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary\"},\"author\":{\"name\":\"\",\"@id\":\"\"},\"headline\":\"Ruby on Rails File uploads With CarrierWave and Cloudinary\",\"datePublished\":\"2012-04-09T12:24:04+00:00\",\"dateModified\":\"2025-03-30T08:51:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary\"},\"wordCount\":724,\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1647045705\/47_ruby_uploads\/47_ruby_uploads.jpg?_i=AA\",\"keywords\":[\"File-upload\",\"Ruby on Rails\"],\"inLanguage\":\"en-US\",\"copyrightYear\":\"2012\",\"copyrightHolder\":{\"@id\":\"https:\/\/cloudinary.com\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary\",\"url\":\"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary\",\"name\":\"Ruby on Rails File Uploads Using CarrierWave Gem\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary#primaryimage\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1647045705\/47_ruby_uploads\/47_ruby_uploads.jpg?_i=AA\",\"datePublished\":\"2012-04-09T12:24:04+00:00\",\"dateModified\":\"2025-03-30T08:51:42+00:00\",\"description\":\"Leverage the combination of Cloudinary with its CarrierWave-based gem to upload and manage image files with excellent model binding.\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary#primaryimage\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1647045705\/47_ruby_uploads\/47_ruby_uploads.jpg?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1647045705\/47_ruby_uploads\/47_ruby_uploads.jpg?_i=AA\",\"width\":2000,\"height\":1100},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudinary.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ruby on Rails File uploads With CarrierWave and Cloudinary\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"name\":\"Cloudinary Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudinary.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\",\"name\":\"Cloudinary Blog\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"width\":312,\"height\":60,\"caption\":\"Cloudinary Blog\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Ruby on Rails File Uploads Using CarrierWave Gem","description":"Leverage the combination of Cloudinary with its CarrierWave-based gem to upload and manage image files with excellent model binding.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary","og_locale":"en_US","og_type":"article","og_title":"Ruby on Rails File uploads With CarrierWave and Cloudinary","og_description":"Leverage the combination of Cloudinary with its CarrierWave-based gem to upload and manage image files with excellent model binding.","og_url":"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary","og_site_name":"Cloudinary Blog","article_published_time":"2012-04-09T12:24:04+00:00","article_modified_time":"2025-03-30T08:51:42+00:00","og_image":[{"width":2000,"height":1100,"url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1647045705\/47_ruby_uploads\/47_ruby_uploads-jpg?_i=AA","type":"image\/jpeg"}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary#article","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary"},"author":{"name":"","@id":""},"headline":"Ruby on Rails File uploads With CarrierWave and Cloudinary","datePublished":"2012-04-09T12:24:04+00:00","dateModified":"2025-03-30T08:51:42+00:00","mainEntityOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary"},"wordCount":724,"publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1647045705\/47_ruby_uploads\/47_ruby_uploads.jpg?_i=AA","keywords":["File-upload","Ruby on Rails"],"inLanguage":"en-US","copyrightYear":"2012","copyrightHolder":{"@id":"https:\/\/cloudinary.com\/#organization"}},{"@type":"WebPage","@id":"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary","url":"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary","name":"Ruby on Rails File Uploads Using CarrierWave Gem","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary#primaryimage"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1647045705\/47_ruby_uploads\/47_ruby_uploads.jpg?_i=AA","datePublished":"2012-04-09T12:24:04+00:00","dateModified":"2025-03-30T08:51:42+00:00","description":"Leverage the combination of Cloudinary with its CarrierWave-based gem to upload and manage image files with excellent model binding.","breadcrumb":{"@id":"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary#primaryimage","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1647045705\/47_ruby_uploads\/47_ruby_uploads.jpg?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1647045705\/47_ruby_uploads\/47_ruby_uploads.jpg?_i=AA","width":2000,"height":1100},{"@type":"BreadcrumbList","@id":"https:\/\/cloudinary.com\/blog\/ruby_on_rails_image_uploads_with_carrierwave_and_cloudinary#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudinary.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Ruby on Rails File uploads With CarrierWave and Cloudinary"}]},{"@type":"WebSite","@id":"https:\/\/cloudinary.com\/blog\/#website","url":"https:\/\/cloudinary.com\/blog\/","name":"Cloudinary Blog","description":"","publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudinary.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/cloudinary.com\/blog\/#organization","name":"Cloudinary Blog","url":"https:\/\/cloudinary.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","width":312,"height":60,"caption":"Cloudinary Blog"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":""}]}},"jetpack_featured_media_url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1647045705\/47_ruby_uploads\/47_ruby_uploads.jpg?_i=AA","_links":{"self":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/21118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/comments?post=21118"}],"version-history":[{"count":4,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/21118\/revisions"}],"predecessor-version":[{"id":37294,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/21118\/revisions\/37294"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media\/23380"}],"wp:attachment":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media?parent=21118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/categories?post=21118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/tags?post=21118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}