Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8327385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:05:31+00:00 2026-06-09T01:05:31+00:00

I have this uploader class class ImageUploader < CarrierWave::Uploader::Base include CarrierWave::RMagick process :resize_to_limit =>

  • 0

I have this uploader class

class ImageUploader < CarrierWave::Uploader::Base

  include CarrierWave::RMagick

  process :resize_to_limit => [300, 300]

  version :thumb do
    process :resize_to_limit => [50, 50]
  end

 ...

Which will process the original file to 300×300 and save a thumb version.

I would like to be able to make a small/thumb version only based on a boolean on my model?

So I did this

if :icon_only?
 process :resize_to_limit => [50, 50]
else
  process :resize_to_limit => [300, 300]
end

protected

 def icon_only? picture
   model.icon_only?
 end

But it always ended up in 50×50 processing. Even when I did like this

 def icon_only? picture
   false
 end

I might got my syntax up all wrong with the : but i also tried asking

if icon_only?

Which told me there was no method name like that.Im lost…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T01:05:32+00:00Added an answer on June 9, 2026 at 1:05 am

    Use an :if conditional, like so:

    process :resize_to_limit => [50, 50], :if => :icon_only?
    process :resize_to_limit => [300, 300], :if => ...
    

    I haven’t actually tried this but it’s documented in the code, so it should work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a java code like this: private class Uploader implements Runnable { //
I have two models, each with their own Carrierwave uploaders: class User < ActiveRecord::Base
Newbie question. I have Django models that look like this: class Video(models.Model): uploaded_by =
I have a function like this in actionscript3 private function uploadFile(event:MouseEvent):void { var uploader:URLRequest
I now have a file uploader that goes on like this This is the
I have an CarrierWave ImageUploader which creates a couple of versions of an original
In this SO question I see the following: class MediaContent(models.Model): uploader = models.ForeignKey(User) title
I have video model with the following definition: class Video require 'carrierwave/orm/activerecord' mount_uploader :attachment,
Hi, I have a View class that contains a list, this list explains the
Given some Uploader Class, I have three modules included in it. They have each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.