Skip to content
Browse files

Merge pull request #90 from simi/patch-1

Nicer README.md with GitHub flavored markdown
  • Loading branch information...
2 parents eab6d56 + e9e41dd commit b1ca59e0408d5b01f6b403c458eced9eae8a303d @rmm5t rmm5t committed Feb 25, 2013
Showing with 14 additions and 6 deletions.
  1. +14 −6 README.md
View
20 README.md
@@ -14,11 +14,15 @@ Install the latest release:
Require it in your code:
- require 'carrierwave/mongoid'
+```ruby
+require 'carrierwave/mongoid'
+```
Or, in Rails you can add it to your Gemfile:
- gem 'carrierwave-mongoid', :require => 'carrierwave/mongoid'
+```ruby
+gem 'carrierwave-mongoid', :require => 'carrierwave/mongoid'
+```
## Getting Started
@@ -28,14 +32,18 @@ Follow the "Getting Started" directions in the main
[Suggested] Add the field to your attr_accessor list for mass assignment
protection:
- attr_accessible :avatar, :avatar_cache
+```ruby
+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!
+```ruby
+u = User.new
+u.avatar = File.open('somewhere')
+u.save!
+```
## Using MongoDB's GridFS store

0 comments on commit b1ca59e

Please sign in to comment.
Something went wrong with that request. Please try again.