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')
Using Rails 4 and Devise 3.1.0 on my web app. I wrote a Cucumber test to test user sign up; it fails when the "confirm my account" link is clicked from the e-mail. Scenario: User signs up with valid data # features/users/sign_up.feature:9 When I sign up with valid user data # features/step_definitions/user_steps.rb:87 Then I should receive an email # features/step_definitions/email_steps.rb:51 Whe
I have been googling for about 90 minutes now and still don't have an answer to this. Where do I set default_url_options? I've already set it for config.action_mailer.default_url_options to solve this same bug elsewhere, but now I'm getting this error when trying to use a URL helper inside an RSpec spec. I have no idea where it's expecting default_url_options to be set. Failure/Error: listing_url(
I'm following the RoR Tutorial and I'm stuck at Listing 9.15 I getting the following error after running 'bundle exec rspec spec/' : 1) Authentication authorization as wrong user submitting a PATCH request to the Users#update action Failure/Error: specify { expect(response).to redirect_to(root_url) } ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_option
I have added a field to the sign-up form that is based on a different model, see How do I use nested attributes with the devise model for the gory details. This part is working fine. The problem now is when I save, it is failing in the create action of the registrations controller that is supplied by devise with an Activerecord::UnknownAttributeError on this field (company). I am assuming I need t
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
asset_sync gem error :( The first error I started out with was related to the unf gem, so I added gem "unf", "~> 0.1.3" to my gemfile and tried things again. No luck :( After more research I may have an issue with another setting related to my aws bucket. My dns is hosted via route53 and I wanted to use a custom domain to serve my assets. This means my bucket will look like assets.domain.com inste
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く