README.md in dynamic_paperclip-0.0.1 vs README.md in dynamic_paperclip-0.0.2
- old
+ new
@@ -50,10 +50,14 @@
has_dynamic_attached_file :avatar
```
You can continue defining styles there, too, you don't need to move over entirely to dynamic styles. You can have both!
+**Note:** Dynamic Paperclip requires that the ``:style`` **and** either the ``:id`` or ``:id_partition`` be included
+in the ``:url`` that you specify when defining the attachment. Paperclip includes them by default, so this only
+applies if you've specified your own.
+
Then, whenever you'd like a URL to a dynamic style, simply call ``#dynamic_url`` instead of ``#url`` on the attachment,
passing it the style definition that you would normally define in the ``:styles`` hash on ``has_attached_file``:
```ruby
@user.avatar.dynamic_url('100x100#')
@@ -114,16 +118,16 @@
```
Dynamic Paperclip will generate the following route:
```ruby
-get '/system/users/:attachment/:id/:style', to: 'DynamicPaperclip::AttachmentStyles#generate_user'
+get '/system/users/:attachment/:id/dynamic_:definition', to: 'DynamicPaperclip::AttachmentStyles#generate_user'
```
Now, in your view, you might call something like this:
```ruby
-@photo.avatar.dynamic_url('50x50')
+@user.avatar.dynamic_url('50x50')
```
Which will return the following url (assuming a JPG avatar and a User ID of 42):
```