I have a rails application that has multiple models with paperclip attachments that are all uploaded to S3. This app also has a large test suite that is run quite often. The downside with this is that a ton of files are uploaded to our S3 account on every test run, making the test suite run slowly. It also slows down development a bit, and requires you to have an internet connection in order to wo
I have this code I use to get avatars from Facebook... if auth.info.image.present? user.update_attribute(:avatar, URI.parse(auth.info.image)) end When I try to load the code now I get this error: A RuntimeError occurred in authentications#create: redirection forbidden: http://graph.facebook.com/672086173/picture?type=square -> https://fbcdn-profile-a.akamaihd.net/hprofile-ak-prn2/t5.0-1/1086349_67
Yep! Here's a custom validation I wrote for my app, it should work verbatim in yours, just set the pixels to whatever you want. def file_dimensions dimensions = Paperclip::Geometry.from_file(file.queued_for_write[:original].path) self.width = dimensions.width self.height = dimensions.height if dimensions.width < 50 && dimensions.height < 50 errors.add(:file,'Width or height must be at least 50px')
First off, when you create a check_box in a form_for (which it looks like you are), then the form should by default send :image_delete as "1" if checked and "0" if unchecked. The method declaration looks like this: def check_box(method, options = {}, checked_value = "1", unchecked_value = "0") Which shows that you can assign other values if you want to, but that is of course optional. Secondly, th
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く