Permalink
Browse files

Merge pull request #43 from genexp/master

Small documentation upgrade.
  • Loading branch information...
2 parents 3fce922 + bf4df91 commit fefb66265926bb25c623685c1f57a0e478e2459d @rmm5t rmm5t committed May 15, 2012
Showing with 19 additions and 3 deletions.
  1. +19 −3 README.md
View
@@ -6,19 +6,35 @@ This functionality used to be part of CarrierWave but has since been extracted i
## Installation
+Install the latest release:
+
gem install carrierwave-mongoid
-## Requiring the gem
+Require it in your code:
require 'carrierwave/mongoid'
-## Using Bundler
+Or, in Rails you can add it to your Gemfile:
gem 'carrierwave-mongoid', :require => 'carrierwave/mongoid'
+## Getting Started
+
+Follow the "Getting Started" directions in the main [Carrierwave repository](https://raw.github.com/jnicklas/carrierwave/).
+
+[Suggested] Add the field to your attr_accessor list for mass assignment protection:
+
+ attr_accessible :avatar, :avatar_cache
+
+Now you can cache files by assigning them to the attribute; they will automatically be stored when the record is saved. Ex:
+
+ u = User.new
+ u.avatar = File.open('somewhere')
+ u.save!
+
## Using MongoDB's GridFS store
-You'll need to configure the database and host to use:
+Optionally, you can configure Carrierwave to use GridFS instead of the filesystem. Ex:
```ruby
CarrierWave.configure do |config|

0 comments on commit fefb662

Please sign in to comment.