选择有意义。但是有人可以向我解释.detect吗?我不明白这些数据。>>[1,2,3,4,5,6,7].detect{|x|x.between?(3,4)}=>3>>[1,2,3,4,5,6,7].detect{|x|x.between?(3,6)}=>3>>[1,2,3,4,5,6,7].detect{|x|x.between?(3,7)}=>3>>[1,2,3,4,5,6,7].detect{|x|x.between?(2,7)}=>2>>[1,2,3,4,5,6,7].detect{|x|x.between?(1,7)}=>1>>[1,2,3,4,5,6,7].detect{|x
我想在上传时使用Paperclip裁剪图像,以从原始图片的中心获得方形拇指。我在文档中找到了一种方法,它似乎完全符合我的要求:transformation_to(dst,crop=false)问题是我不知道在哪里使用这个方法。在这里简单地传递一些东西作为参数会很棒:has_attached_file:picture,:styles=>{:medium=>"600x600>",:thumb=>"somethinghere"} 最佳答案 你只需要使用#而不是>作为参数:has_attached_file:picture,:styles=