![]() ![]() Photos_controller.rb class PhotosController < ApplicationController Now, it is time to hook up some Bootstrap filesĪnd create a PhotosController that will be empty for now: Rack-cache is a simple solution for caching in productionĮnvironment that you can use for small projects (for large ones you should implement a reverse caching proxy). This if for styling purposes and not necessary to use Dragonfly Gem 'rack-cache', :require => 'rack/cache'ĭragonfly is a highly customizable Ruby gem for handling images and other attachments created by Mark Evans, as well as our main subject today.ĭragonfly-s3_data_store is an extension for dragonfly that allows storing files using Amazon S3 cloud services (we are going to talk about that later).īootstrap-sass a gem that brings in Twitter Bootstrap. Open your Gemfile and add the following gems: Okay, create a new app without the default testing suite: rails new uploader -T That will be followed by adding validations, integration with Amazon S3, and, finally, some optimizations. For the first iteration, the app will be a very basic system that allows uploading of any kind of file. Let’s create a simple web app that will allows users to share (upload) their photos. I will use Rails 4.1.1 for this demo, but you can implement the same solution with Rails 3 There is a detailed guide explaining how to migrate to the latest version – I was able to migrate in no time. Please note that, if you are still using Dragonfly 0.9 or earlier there is a new Dragonfly 1.0 that has some breaking changes. If you are not familiar with this gem, I hope that I’ve convinced you to (at least) take a look at it :) It has a bunch of extensions (every extension is provided in its own gem).It has a framework for creating custom image analysers and generators, as well as plugins. ![]() ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |