Skip to content

Commit

Permalink
Documented Rails 4 helper in Readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ezuhaib committed May 8, 2014
1 parent 126faca commit 8a7377b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,24 @@
:avatar_crop_y, :avatar_crop_w, :avatar_crop_h, :avatar_aspect

provided that the attachment name is `avatar`.

1. If using **Rails 4** , add this:

cropping_params(:avatar)

where `:avatar` is the name of attachment as defined in your model. You can use this helper in two ways:

@user.update_attributes(cropping_params(:avatar)

or

def user_params
params.require(:user).permit(:email,:password,:password_confirmation)
cropping_params(:avatar)
end

The difference is that the former only allows cropping paramters through, which is useful if you are using a seperate cropping page. The later is useful if the cropping box is somehow integrated with another form.

1. Includes minified resources. Saves an additional ~30kB.

For full documentation, visit the [original repository](https://github.com/rsantamaria/papercrop).
Expand Down

0 comments on commit 8a7377b

Please sign in to comment.