Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "only version(s)" and data html attributes for javascript #16

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

sunchess
Copy link

@sunchess sunchess commented Sep 7, 2015

You can set versions where need to crop.

    #Version for ipad
    version :ipad_main do
      process crop: :image
    end

    #Set crop versions for example in _ipad.html.erb partial
    <%= f.cropbox :avatar, only: :ipad_main %>

    #Version for android
    version :android_main do
      process crop: :image
    end

    #Set crop versions for example in _andtoid.html.erb partial
    <%= f.cropbox :avatar, only: :android_main %>


    #or both
    <%= f.cropbox :avatar, only: [:ipad_main, :android_main] %>

If you need to html data attributes you can set data option

    <%= f.cropbox :avatar, data: {width: 1024, height: 768} %>

    #and you can use it in javascript

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant