Ruby on Rails Carrierwave Uploader
$10-30 USD
Paid on delivery
I am looking to set a default field for a file upload form using the Carrierwave Gem. I already use the following code to set the default title to the filename:
before_create :default_filename
def default_filename
[url removed, login to view] ||= [url removed, login to view]([url removed, login to view], ".*").titleize if file
end
What I would like to do is have another before_create that sets the file "Type"
IF the file extension is .png, .jpg, .jpeg, .gif -> set the "type" field to "image"
IF the file extension is .pdf, .doc -> set the "type" field to "file"
Project ID: #11472356
About the project
Awarded to:
Dear, When I read this job I feel very excited to be a part of your project and share my great experience in software development. I have experience to manage Ruby on Rails developers team. I know thorough how More
3 freelancers are bidding on average $27 for this job
Hi there, I’d like to be considered for your writing position. I’m a strategic Developer with a strong background developing Websites, including CMS, blog posts, social media posts, articles, press releases and ot More
Hello, I have 8 years experience i am Web Developer . I am working as a full time freelance. As a freelance web Developer, I developed websites for many companies and individuals from small to large businesses. MY P More