In my rails app I am using carrierwave for images. Carrierwave creates different versions of an image and the url can be obtained like this: picture.large.url, picture.small.url, picture.thumb.url, etc.
I would like to create a method that can accept a string argument that can then be used for the image url. Something like this:
def profile_url (version)
picture.version.url
end
So then I can write @user.profile_url('thumb') and it should give me the url in thumb size.
I get an undefined method 'version' error. Is this possible?
url, i.e.picture.url('thumb')