Thee best up to date tutorial I have seen thus far. There are no up to date tutorials dealing with rails. The one I saw before yours was a year ago. It was very helpful, but old by programming standards. And just ran int this image issue yesterday. Great timing
This tutorial was all kinds of awesome. Took something that might have taken hours on my own, and boiled it down to a few minute task for me. Thanks for the help!
Nice video as always! Now I'm trying to do multi image uploading with paperclip and simpleform, in a one to many relationship: a product can have many images. Struggling with that!.
Jorge Venegas Thanks! I stumbled across this the other day. Maybe it'll help: 5minutenpause.com/blog/2013/09/04/multiple-file-upload-with-jquery-rails-4-and-paperclip/
Hi Mackenzie Child , Great post on using paperclip gem. It would be great to see how you would upload images that display within the body of the blog post. And allow a blog post to have multiple images. Most blogs incorporate images within the body. Thanks
Hey Mackenzie, what do you think about making a video where you go over how to create a devise registration system with two types of user. For example, when you go to a website like elance you can signup as either "wanting to find work" Versus "wanting to find clients" with different abilities for each. Your videos are amazing!
Hey there, thanks :) I'm not sure when I'll make it, but I do have the topic of creating admins / users with devise and cancan on my list of topic ideas!
Awesome tute Mackenzie, and still relevant! I'm trying to figure out how I can use paperclip to attach images to my seed files right from my assets folder, so I'd be able to hit `rake db:seed` and have a bunch of posts with images already attached from the get go. Any ideas how I can make that happen? Thanks!
So this was really insightful and does an extremely good job of explaining how to use the paperclip gem. My question might be out of your scope but if you could answer it, I'd appreciate it. Im building a one page app using backboneJS as a front end and rails as my backend but Im confused on how I would be able to upload an image. My views are constructed by backboneJS so I can never hardcode it because they are written in EJS (equivialent of ERB but JS). What should I do? Also, more of a conceptual question, are the images stored in your database? Or are they stored in a paperclip folder and then the database just holds the path to that folder containing the image.
whattehjeff Never used backbone before so off the top of my head I'm not sure. Also, in development they are stored locally, but on Production you need to use something like Amazon AWS or something to store the images.
Thanks Mackenzie. I need to upload an image from an Angular2 front end to the rails api. I have integrated Paperclip in the rails back end but I am not able to send the image file using http post request from Angular 2 frontend. Any advice will be really appreciated
Hey the video is very good. I wanted to know how to save image under the folder given by user. Suppose I am taking folder as input and user want to save image into that folder.
Hi Mackenzie Child I love your videos. They are simply awesome. I have a problem. When i used paperclip for uploading avatar I am getting error "Avatar has an extension that does not match its contents". Can you solve this for me please......
Hey, great video, thanks so much. I followed the video step by step a couple of times however I keep getting the same issue, when I upload the image i'm getting 'image missing' - any ideas, thanks again soooo much. -im using c9.io
Hi, i'm facing new problem in my new app. While everything seems to be fine in another app. When i upload an image i'm getting - "has an extension that does not match its contents".
Nice video. What if I wanted a gallery for each post? How can I have the ability to tack on images to a single post model? For instance, I made a post of "My 3 kittens" and then you have 3 separate images of Snuffles, Mittens, and Shitters. Thanks.
Hey there!! Great video! You really helped me but I have one tiny problem, how can I delete or destroy a post if the post have an image? Because when I tried, rails saids that I can delete the image, so can you help me please!! And also how can I upload more than one image to a single post? Thanks for all your videos!! :)
Hey Mackenzie dude, thanks for the tutorial. I am having some trouble with the paperclip. Everytime I edit the resource, the file field drops the file, which means that the user has to upload the image every time he wants to edit anything. Its a pain. How can I make the image persist on the form.
Nicolas Rivers Thanks! Well I don't think it's dropping the file, but rather you may be forcing your user to upload a new one. Are you validating the presence of the image? You could verify that an image is already uploaded by actually putting the image inside your view of your edit form... So you could do a conditional like which would only show the image if the user has uploaded it... Otherwise there'd be a broken image icon.
Yeah , sorry I understand it but I dont know how I would write it... Here is the form helper that I am using: The instance being defined is @user. how do I insert that image_tag into the form field? I am seaching SOF for answers but there is only one really confusing answer with no up votes. I apologize for my newbness.
this help me really much, but i have a error. the pic i choose doesn't show at the localhost when the go online the rails server. can you help me whit that?
Hi, Quick question... For some reason I'm unable to see the photo once uploaded, why could this be? I'm not getting any errors whatsoever, however after a user uploads a post, the image is nowhere to be seen. What should I do? Thanks!!
You've inspired me to try to do my own channel as well, I've been wanting to for some time. Can you point me in the right direction to creating the intro you've made? All the tutorials I've found aren't for a subtle intro. they're for loud and obnoxious ones. I like how clean and elegant yours is and Im wanting to emulate the same feel for my channel. Thanks in advance.
John McConnell That's awesome John! I created the intro using motion 5 with the basic text animation filters that come with. Then my brother (a music producer) created the sound effects for me. Good luck with your channel :)
Mackenzie Child very cool, yeah i have spent some time with logic and have a midi keyboard so i'll be making my own sounds too. I've been trying to learn enough blender to make a clean intro but i don't think it's quite the right tool as much as after effects would be. Thanks again. Cant wait to watch more of your videos.
thanks again for the motion 5 tip, i was looking for alternatives and didn't know about motion 5. Looks like it will play nicely with my final cut pro knowledge and it's price point of 50 dollars is extremely lovable.
Mackenzie Child I agree it fits the feel of your work nicely. I'm also accustom to many adobe programs. Are we going to see some illustrator tutorials out of you in the future? I'd love to learn more about design theory, im a welp it looks like crap time to erase it and start over until something great happens kinda guy myself.
can you just give an idea to me how to make a post "if its news we site " have a youtube vidoes and images and also text i tried to use Redator but its only plays the video on new.html.erb , but when i want to see the article or the post it shows me the embedd code :P
Mack thank you very much, please can you help me, everything seems to work except that i cant't see the image, what i am seeing on my browser is, Missing. please what can i do to let the image appear?
Hey Mackenzie Child awesome tutorial. Do you mind extending this tutorial and shedding some light on how to integrate paperclip with say dropzonejs or any other jquery compatible file uploading library. The file_field by itself is ugly, and it would be more intuitive to drag and drop images into the web app. It would be really awesome if you consider an example where there is a model such as a user or a product which has multiple attributes along with an image. I tried searching for an example of this but most of the tutorials out there demonstrate file upload for a file model, which I think is not very railsy as most files and/or images are part of a more generic model such as user or product. I know I'm asking to much here, but I have faith in your videos more than anything out there. I hope you consider this. Thanks.
You'd set either a default image (an image that would get loaded if there isn't one on the post) OR use a condition ruby statement to only show the image if it exists.
How would you do something like this for video? I think the auto_html gem is what I should use, but Im still really new to Ruby so I have no idea how to implement it.
Hey Mackenzie Child, I just followed all of your steps in my RoR app. Unfortunately it is not working. Additionally there is no error message. One major difference between your and my app is that I use a MySQL database. Would you please show the output of the command "SHOW COLUMNS FROM posts" in your database? And would you please explain where the images are saved on your machine (whether it is the database or on your filesystem)? Here is the output on my console when I create a product: Started POST "/products" for 127.0.0.1 at 2015-06-21 11:02:53 +0200 Processing by ProductsController#create as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"5SomZV5YRce6KcvilsAvnCqegQJh+lRQecUobfWmf0I=", "product"=>{"name"=>"hundi", "category"=>"hund"}, "commit"=>"Create Product"} (0.1ms) BEGIN SQL (0.4ms) INSERT INTO `products` (`category`, `created_at`, `name`, `updated_at`) VALUES ('hund', '2015-06-21 09:02:53', 'hundi', '2015-06-21 09:02:53') (1.8ms) COMMIT Redirected to localhost:3000/products/2 Completed 302 Found in 8ms (ActiveRecord: 2.3ms) As you can see - the image is not appearing in this code. What is wrong? Thank you in advance, Niklas
yes I have permitted the image in my controller, but the columns(image_filen_name, image_content_type etc) in my sql database stay empty. I've read a lot about the folder /public/system/... but this folder doesn't exist in my app. I hope you can help me here.
Like I said before, I love all your videos and I am looking fwd to seeing more n more videos. By any chance, did you forget to mention configuration part of Peperclip ? PaperClip.options[:image_magick_path] = "/opt/ImageMagick/bin" PaperClip.options[:command_path] = "/opt/ImageMagick/bin"
Thanks Mackenzie, but once we deploy in heroku, we have to find another solution to upload images like aws since heroku doesn't support static assets.. do you agree?
Mackenzie Child Here's a link to my Stack Overflow question. I posted an answer to it. I'll be happy to explain further if you need. stackoverflow.com/questions/27810317/copy-a-paperclip-image-to-a-new-record-in-rails-4/27811021?noredirect=1#comment44060297_27811021
What does it mean when you follow tutorials exactly, and look through the gem documentation and it still doesn't work? It seems like it worked for everyone else except me. I do have ImageMagick installed on my Linux, but for some reason when I try to upload images through the form it doesn't work.
It's gotta be my computer. Maybe some particular file for ImageMagick didn't install correctly. I followed the tutorial about 4 times through carefully and still nothing.
I'm just going to switch to Carrierwave. But I had the error messages turned off during my run-throughs so I couldn't see them at the time. I just know they were coming from the upload image part because the layout would change there and nowhere else.
Michael Lawrence Checkout DragonFly too... I've heard from many people that it's pretty awesome! (I'll be making a video on that at some point... Probably one on Carrierwave too). But sorry you're not getting it to work... I know how annoying / frustrating that is!
I installed Imagemagick but when i run which convert it says which is not recognized as an internal or external command ? m using windows and m unable to run paperclip gem
Alexander Lee Yes, I plan to at some point :) In the meantime if you're in a hurry, I cover that topic in my new course: www.unicasts.com/courses/podcast-fm/
+Basic Growth Heroku doesn't play well with uploaded images... To get them to stay you'll need to setup something like AmazonS3... Check this video out: mackenziechild.me/podcast-network/store-assets-on-amazon-s3/
Hey Mackenzie! Sweet, I got it working & my (fairly) ugly portfolio is now online ^^ I still am pretty bad at design though. But it's progress nevertheless www.simonsomlai.com/ - Simon
Nice Videos Tutorials. Thank you very much. Maybe a hint for the next videos: A little talk about the tech background would be nice, like: "images where saved there, the framework saves the path in the database... blabla". You know it and it only cost you a more minute in the video.
What if I am running my Rails app with a website like c9.io since i'm using a school laptop and don't have permissions for downloading things? How do I get ImageMagick? It's urgent :(
Hey hi, when i upload a image i'm getting this error - "Image Paperclip::Errors::NotIdentifiedByImageMagickError". By the way i'm using windows, installed imagemagick too.
Thanks so much for this video! I combined this gem with my portfolio website, which I built by following your course. :) Unfortunately paperclip in combination with amazon s3 gives me an Application error on heroku. Locally it works great though. Can any one help me?
+Mackenzie Child, Sorry I am a bit nuts but I'm a very begginner in Ruby on rails ( and in Ruby too **sigh**). It could be because I haven't use the scaffold thing in the beginning of my project. I've used devise to create my forms and I have two kind of users, which are redirected according to who they are... for exemple shop_keepers and clients... Shop_keepers have to complete their profile with a picture of their shop... So I've added all in my shop_keeper controller and views (new and show...) Sorry if it's not very clear... Hope you see what I mean :D
You should spend a little time practicing... Maybe try going through all my 12 in 12 videos as well as my new courses and then take that knowledge and apply it to building your own project(s). I think building a bunch of demo apps will help you get a feel for how things work a bit better :)
+Caohuu Quocminh I just solved this problem! Install the exe by download the exe from this link file.exe test if is well installed by running your cmd and put the following instructions convert logo: logo.miff then run ' imdisplay logo.miff ' you will get custom logo image,that will pop up on your windows screen. From here now you can start configuring everything on rails app Open config/environments/development.rb Add the following line: Paperclip.options[:command_path] = 'C:\tools\GnuWin32\bin' If your rails server is currently running,brake the server and then run again rails s.After that you should be ready to go.Upload image on your app
Newb question..... If I am allowing users to attach multiple images to a post, would you recommend generating an image model and then working that into my posts model? I found this for reference: bit.ly/1GpJtYa - I just didn't know how to work it into what I just did with this video without having previously creating an image model
Zach Ford Yeah I think you'd want to create an 'asset' (or images) model, then associate that with your posts model. Check out this StackOverflow for reference: stackoverflow.com/questions/24597721/rails-4-multiple-image-upload-using-paperclip
Mackenzie Child Bossman! Still figuring out multiple image upload... I'm guessing the same principles you outlined in the video would apply to comments? Like if I wanted a user to be able to attach 1 image per comment. The only hiccup I can see for me is that there is no comment_params set up in my app.
I love the gem system for managing plugins I just hate some of the names some are cool like Capybara for testing but others need some work I was surprised to find a gem called cocaine in my gem list. apparently for commandline fu ... just a really bad choice. Pardon the pun.
Thee best up to date tutorial I have seen thus far. There are no up to date tutorials dealing with rails. The one I saw before yours was a year ago. It was very helpful, but old by programming standards. And just ran int this image issue yesterday. Great timing
Thats awesome! And thank you very much :)
I'm really pumped for your newer vids. You are a big inspiration to me bro.
That means a ton man, thanks so much!!
Your interview really lit a fire under my butt dude. fist bump.
DevTips Haha, thats awesome. *fist bump* :)
I was super inspired by all your stuff when I found it! Been hustling pretty hard to catch up, haha.
I love you. I've been struggling with paperclip more than I want to admit and you saved me ! Thnks!
+Constanza Osorio Yay!
This tutorial was all kinds of awesome. Took something that might have taken hours on my own, and boiled it down to a few minute task for me. Thanks for the help!
greenlighteningMIT Glad it was helpful :)
Your tutorials are great and very supportive in the learning process. Thanks for your effort and time to share :D
Kuki Atama Thanks :)
This video really cleared up a lot issues I've had with Paperclip! Thanks for this!
+Paulo Aquino Awesome! Glad it helped :)
Nice video as always! Now I'm trying to do multi image uploading with paperclip and simpleform, in a one to many relationship: a product can have many images. Struggling with that!.
Jorge Venegas Thanks! I stumbled across this the other day. Maybe it'll help: 5minutenpause.com/blog/2013/09/04/multiple-file-upload-with-jquery-rails-4-and-paperclip/
This channel is so underrated. Cheers for the tutorial!
I'm so glad I found this TH-cam channel you are so helpful.
Thanks Sam :)
you are biggest inspiration for me right now...
YASSSSS I'VE BEEN STUCK AT THIS FOR SO LONG, THANKS MACKENZIE
Awesome :)
You have the power to go far
Keep up the good work Mackenzie
Thanks so much :)
Hi Mackenzie Child , Great post on using paperclip gem. It would be great to see how you would upload images that display within the body of the blog post. And allow a blog post to have multiple images. Most blogs incorporate images within the body. Thanks
Hey Mackenzie, what do you think about making a video where you go over how to create a devise registration system with two types of user. For example, when you go to a website like elance you can signup as either "wanting to find work" Versus "wanting to find clients" with different abilities for each. Your videos are amazing!
Hey there, thanks :)
I'm not sure when I'll make it, but I do have the topic of creating admins / users with devise and cancan on my list of topic ideas!
any plans for a rails 5+ guide or 12 apps series?
hi Mackenzie, I want a user to upload more than one pic when posting an ad to and use it as image carousel...how do I do that? thanks in advance
Awesome tute Mackenzie, and still relevant! I'm trying to figure out how I can use paperclip to attach images to my seed files right from my assets folder, so I'd be able to hit `rake db:seed` and have a bunch of posts with images already attached from the get go. Any ideas how I can make that happen? Thanks!
So this was really insightful and does an extremely good job of explaining how to use the paperclip gem. My question might be out of your scope but if you could answer it, I'd appreciate it. Im building a one page app using backboneJS as a front end and rails as my backend but Im confused on how I would be able to upload an image. My views are constructed by backboneJS so I can never hardcode it because they are written in EJS (equivialent of ERB but JS). What should I do?
Also, more of a conceptual question, are the images stored in your database? Or are they stored in a paperclip folder and then the database just holds the path to that folder containing the image.
whattehjeff Never used backbone before so off the top of my head I'm not sure. Also, in development they are stored locally, but on Production you need to use something like Amazon AWS or something to store the images.
Great tutorial !
I am having a hard time getting it worked on my windows machine & already wasted about 2 hour. Can u suggest something?
Thanks Mackenzie. I need to upload an image from an Angular2 front end to the rails api. I have integrated Paperclip in the rails back end but I am not able to send the image file using http post request from Angular 2 frontend. Any advice will be really appreciated
Hey the video is very good. I wanted to know how to save image under the folder given by user. Suppose I am taking folder as input and user want to save image into that folder.
Kartik Gupta I'll be honest, I'm not quite sure what you mean.
Mackenzie Child Please see this : stackoverflow.com/questions/31248381/to-save-the-image-to-location-specified-by-the-user-in-rails
Hi Mackenzie Child I love your videos. They are simply awesome. I have a problem. When i used paperclip for uploading avatar I am getting error "Avatar has an extension that does not match its contents". Can you solve this for me please......
Thanks for this videos, it worked good for me, bet i am trying to inserte image via command line, because i have a lot. it is possible ?
Hello, could indicate some current tutorial upload multiple images?
Congratulations on the videos. very good!
+Charles Bronson Checkout this Charles - 5minutenpause.com/blog/2013/09/04/multiple-file-upload-with-jquery-rails-4-and-paperclip/
Also, thank you :)
great vid ! I'm guessing this also works for videos?
+Luis Santiago I believe it's a similar process but not exactly the same: stackoverflow.com/questions/21491643/rails-video-uploading
Mackenzie Child ok cool thanks. I trying to post videos to my website from active admin dashboard.
Hey, great video, thanks so much. I followed the video step by step a couple of times however I keep getting the same issue, when I upload the image i'm getting 'image missing' - any ideas, thanks again soooo much. -im using c9.io
hey did you found any solution for that?? I am getting the same error :(
any solutions for this? I have the same error
Really great Mackenzie,You made complex work to simple.Add a video with multi file upload using paperclip it helps us more.
Glad it helped dude!
Great video man! I found the solution to my problem! Now I can use paperclip in my dual api and UI app
This is a great tutorial! Very straight-forward, easy to follow :)
+Josiah Schaefer Thanks Josiah :)
estoy seguro que lo podrás traducir, excelentes videos, tutoriales e instrucciones, la mejor de las suertes, saludos desde mx, all the best!
hey Mackenzie Child,your content is awesome.im wondering is their any javascript framework did you used while making clone applications?
Hi Mackenzie
Thanks for the videos. Could you please make a video on using mailboxer gem to send messages between users?
Thanks.
Yeah I'll add that to my list :)
Thanks!
Thanks Mackenzie :)
Hey, I am using paperclip gem to upload image, it's working great but is there any way I can seed for "seed.rb" to populated my data?
Hi, i'm facing new problem in my new app. While everything seems to be fine in another app. When i upload an image i'm getting - "has an extension that does not match its contents".
Nice video. What if I wanted a gallery for each post? How can I have the ability to tack on images to a single post model? For instance, I made a post of "My 3 kittens" and then you have 3 separate images of Snuffles, Mittens, and Shitters. Thanks.
+MrSatchelpack Maybe this will help you get started - 5minutenpause.com/blog/2013/09/04/multiple-file-upload-with-jquery-rails-4-and-paperclip/
before create post, after choosing the img, i wanna display image url and then I wanna a create a post.. how to do that? please tell
How can I do multiple image uploads to one post?
dropzone gem
Hey there!! Great video! You really helped me but I have one tiny problem, how can I delete or destroy a post if the post have an image? Because when I tried, rails saids that I can delete the image, so can you help me please!! And also how can I upload more than one image to a single post?
Thanks for all your videos!! :)
Hey Mackenzie dude, thanks for the tutorial. I am having some trouble with the paperclip. Everytime I edit the resource, the file field drops the file, which means that the user has to upload the image every time he wants to edit anything. Its a pain. How can I make the image persist on the form.
Nicolas Rivers Thanks! Well I don't think it's dropping the file, but rather you may be forcing your user to upload a new one. Are you validating the presence of the image?
You could verify that an image is already uploaded by actually putting the image inside your view of your edit form... So you could do a conditional like which would only show the image if the user has uploaded it... Otherwise there'd be a broken image icon.
Yeah , sorry I understand it but I dont know how I would write it... Here is the form helper that I am using:
The instance being defined is @user.
how do I insert that image_tag into the form field? I am seaching SOF for answers but there is only one really confusing answer with no up votes. I apologize for my newbness.
You could do something like this inside your view:
Hey Mackenzie Child, Thanks a lot for the video really love it.
Thanks for your time of making this video :)
+Varun Dubey Thanks, glad you liked it :)
Thanks Mackenzie, but can u please make a video about 'Video uploading with paperclip gem'
Quick and awesome tutorials. Thanks!
How to do the same on windows brother??
this help me really much, but i have a error. the pic i choose doesn't show at the localhost when the go online the rails server. can you help me whit that?
Thanks for this video. Great source of information as always. Now to be able to add an image url from the web.
Darin Thompson Thanks :)
+Darin Thompson I don't know why, but I cannot figure this out for the life of me!
Hi,
Quick question...
For some reason I'm unable to see the photo once uploaded, why could this be?
I'm not getting any errors whatsoever, however after a user uploads a post, the image is nowhere to be seen.
What should I do?
Thanks!!
You've inspired me to try to do my own channel as well, I've been wanting to for some time. Can you point me in the right direction to creating the intro you've made? All the tutorials I've found aren't for a subtle intro. they're for loud and obnoxious ones. I like how clean and elegant yours is and Im wanting to emulate the same feel for my channel. Thanks in advance.
John McConnell That's awesome John! I created the intro using motion 5 with the basic text animation filters that come with. Then my brother (a music producer) created the sound effects for me.
Good luck with your channel :)
Mackenzie Child very cool, yeah i have spent some time with logic and have a midi keyboard so i'll be making my own sounds too. I've been trying to learn enough blender to make a clean intro but i don't think it's quite the right tool as much as after effects would be. Thanks again. Cant wait to watch more of your videos.
thanks again for the motion 5 tip, i was looking for alternatives and didn't know about motion 5. Looks like it will play nicely with my final cut pro knowledge and it's price point of 50 dollars is extremely lovable.
Yeah I'm used to Adobe Products, so figuring out how to do stuff with Motion was a pain... But that final product came out nicely :)
Mackenzie Child I agree it fits the feel of your work nicely. I'm also accustom to many adobe programs. Are we going to see some illustrator tutorials out of you in the future? I'd love to learn more about design theory, im a welp it looks like crap time to erase it and start over until something great happens kinda guy myself.
can you just give an idea to me how to make a post "if its news we site " have a youtube vidoes and images and also text
i tried to use Redator but its only plays the video on new.html.erb , but when i want to see the article or the post it shows me the embedd code :P
Mack thank you very much, please can you help me, everything seems to work except that i cant't see the image, what i am seeing on my browser is, Missing. please what can i do to let the image appear?
+chukwuma kingsley So you'd need to use the image tag helper to show the image: stackoverflow.com/a/1912439
Hey Mackenzie Child awesome tutorial. Do you mind extending this tutorial and shedding some light on how to integrate paperclip with say dropzonejs or any other jquery compatible file uploading library. The file_field by itself is ugly, and it would be more intuitive to drag and drop images into the web app.
It would be really awesome if you consider an example where there is a model such as a user or a product which has multiple attributes along with an image.
I tried searching for an example of this but most of the tutorials out there demonstrate file upload for a file model, which I think is not very railsy as most files and/or images are part of a more generic model such as user or product. I know I'm asking to much here, but I have faith in your videos more than anything out there. I hope you consider this. Thanks.
Yeah definitely! I'll add that to my list of ideas :)
If you want to post text with no image, how can you prevent the image load error from showing?
You'd set either a default image (an image that would get loaded if there isn't one on the post) OR use a condition ruby statement to only show the image if it exists.
can u make a tutorial for rails app deployment on nginx server in windows
Question! Does Paperclip create three images from the original?
+Ghost Rider It creates whatever versions you tell it to inside the model (when you specify the, styles: { large: "1000x600>" }, for example.
which program do you use for screen recording?
I don't understand how do you know what you need, for example, change
:content_type => to content_type:
How would you do something like this for video? I think the auto_html gem is what I should use, but Im still really new to Ruby so I have no idea how to implement it.
daguchful This might help: stackoverflow.com/questions/19222492/paperclip-video-upload
Hey Mackenzie Child could you do a tutorial of image uploading but in more depth using s3 for heroku?
Brandon Espinoza A screencast covering how to store images on Amazon S3 is something I'll be covering pretty soon :)
Mackenzie Child That would be really awesome! Really appreciate it. Keep it up!
:)
Can't wait!
Hey Mackenzie Child,
I just followed all of your steps in my RoR app. Unfortunately it is not working. Additionally there is no error message.
One major difference between your and my app is that I use a MySQL database. Would you please show the output of the command "SHOW COLUMNS FROM posts" in your database?
And would you please explain where the images are saved on your machine (whether it is the database or on your filesystem)?
Here is the output on my console when I create a product:
Started POST "/products" for 127.0.0.1 at 2015-06-21 11:02:53 +0200
Processing by ProductsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"5SomZV5YRce6KcvilsAvnCqegQJh+lRQecUobfWmf0I=", "product"=>{"name"=>"hundi", "category"=>"hund"}, "commit"=>"Create Product"}
(0.1ms) BEGIN
SQL (0.4ms) INSERT INTO `products` (`category`, `created_at`, `name`, `updated_at`) VALUES ('hund', '2015-06-21 09:02:53', 'hundi', '2015-06-21 09:02:53')
(1.8ms) COMMIT
Redirected to localhost:3000/products/2
Completed 302 Found in 8ms (ActiveRecord: 2.3ms)
As you can see - the image is not appearing in this code.
What is wrong?
Thank you in advance,
Niklas
Peter Griffin Have you permitted the ':thumbnail' or ':image' or whatever you're using inside your controller?
yes I have permitted the image in my controller, but the columns(image_filen_name, image_content_type etc) in my sql database
stay empty.
I've read a lot about the folder /public/system/...
but this folder doesn't exist in my app.
I hope you can help me here.
Take a look at this: stackoverflow.com/questions/24691948/paperclip-image-not-being-added-in-mysql-database
Like I said before, I love all your videos and I am looking fwd to seeing more n more videos. By any chance, did you forget to mention configuration part of Peperclip ?
PaperClip.options[:image_magick_path] = "/opt/ImageMagick/bin"
PaperClip.options[:command_path] = "/opt/ImageMagick/bin"
Thanks Mackenzie, but once we deploy in heroku, we have to find another solution to upload images like aws since heroku doesn't support static assets.. do you agree?
Yeah, you would need to use something like Amazon AWS to host the images.
Thanks !
All around awesome tutorial! Thanks so much!
Tks Mackenzie for another video.
Mary Chirstimans for you and your family and 2015 with lot of success.
Tks
Thanks Kelber :) Same to you!!
Could you make a paperclip and papercrop tutorial?
hey Mackenxie! do u know why im getting "ttys000" on my terminal?
but i am using windows what can i do
If you have any idea how to copy an image from an existing record to a new form I'd love the help. I've been struggling with it for weeks!
Yeah I'm really not sure man :/ If I ever figure that out though I'll let you know!
I figured out a workaround. Thanks!
Awesome :) What was it if you don't mind me asking??
Mackenzie Child Here's a link to my Stack Overflow question. I posted an answer to it. I'll be happy to explain further if you need. stackoverflow.com/questions/27810317/copy-a-paperclip-image-to-a-new-record-in-rails-4/27811021?noredirect=1#comment44060297_27811021
Oh dude thanks! That is super interesting :)
I may use that technique in the future!
Hello !
I had a problem when i'm uploading an image, Paperclip::AdapterRegistry::NoHandlerError ..
can you help me plz !
How to create a link to download the images which are uploaded?
+Leo Dsilva
Just make an anchor tag that directs to the file / folder and append the word "download" in it. It'll download when clicked.
+Jack Alma (JackHasaKeboard) can you give me a code example.?
+Leo Dsilva Check this out Leo - stackoverflow.com/questions/6756416/rails-link-to-to-download-an-image-immediately-instead-of-opening-it-in-the-br
What does it mean when you follow tutorials exactly, and look through the gem documentation and it still doesn't work? It seems like it worked for everyone else except me.
I do have ImageMagick installed on my Linux, but for some reason when I try to upload images through the form it doesn't work.
Are you getting any error messages or anything? What exactly happens when you say "it doesn't work"?
It's gotta be my computer. Maybe some particular file for ImageMagick didn't install correctly. I followed the tutorial about 4 times through carefully and still nothing.
I'm just going to switch to Carrierwave. But I had the error messages turned off during my run-throughs so I couldn't see them at the time. I just know they were coming from the upload image part because the layout would change there and nowhere else.
Michael Lawrence Hmmm. If that's the case then maybe try uninstalling / reinstalling Imagemagick.
Michael Lawrence Checkout DragonFly too... I've heard from many people that it's pretty awesome! (I'll be making a video on that at some point... Probably one on Carrierwave too).
But sorry you're not getting it to work... I know how annoying / frustrating that is!
I installed Imagemagick but when i run which convert it says which is not recognized as an internal or external command ? m using windows and m unable to run paperclip gem
Programm Ruby on Rails in Windows it's a hard way to go. You may choose a Linux distro or a Mac that's will be more productive.
well if only I could install linux on my laptop (before you say its possible lemme tell u my BIOS are password protected and i dn know the pass :/ )
:/ Try Codeanywhere Cloud IDE
anyway you can do a tutorial on paperclip for heroku deployment?
Alexander Lee Yes, I plan to at some point :) In the meantime if you're in a hurry, I cover that topic in my new course: www.unicasts.com/courses/podcast-fm/
I've put my application on heroku - but the images uploaded to the app don't stay. How can this be solved?
+Basic Growth Heroku doesn't play well with uploaded images... To get them to stay you'll need to setup something like AmazonS3... Check this video out: mackenziechild.me/podcast-network/store-assets-on-amazon-s3/
Hey Mackenzie! Sweet, I got it working & my (fairly) ugly portfolio is now online ^^
I still am pretty bad at design though. But it's progress nevertheless www.simonsomlai.com/
- Simon
Basic Growth Nice :)
Nice Videos Tutorials. Thank you very much.
Maybe a hint for the next videos: A little talk about the tech background would be nice, like: "images where saved there, the framework saves the path in the database... blabla". You know it and it only cost you a more minute in the video.
What if I am running my Rails app with a website like c9.io since i'm using a school laptop and don't have permissions for downloading things? How do I get ImageMagick? It's urgent :(
+Jason Procka
sudo apt-get update
sudo apt-get install imagemagick
+Jason Procka hey, dont know if this is still relevant for you but just try:
$ sudo apt-get update
$ sudo apt-get install imagemagick
Just keep going with this great content :) I hope you will upload more about rails :)
Hey hi, when i upload a image i'm getting this error - "Image Paperclip::Errors::NotIdentifiedByImageMagickError". By the way i'm using windows, installed imagemagick too.
sainath devulapalli Hmmm.. Maybe this Stack Overflow thread will help: stackoverflow.com/a/21184324
Thanks so much for this video! I combined this gem with my portfolio website, which I built by following your course. :)
Unfortunately paperclip in combination with amazon s3 gives me an Application error on heroku. Locally it works great though. Can any one help me?
could you give a solution? :/
Thanks for this great tutorial !
Btw my image doesn't display :( I don't know what went wrong
+MadeInFrance1981 Thanks! Haha I'm not sure either ;) Have you gone through again to double check you didn't miss anything or didn't mistype anything?
+Mackenzie Child, Sorry I am a bit nuts but I'm a very begginner in Ruby on rails ( and in Ruby too **sigh**).
It could be because I haven't use the scaffold thing in the beginning of my project.
I've used devise to create my forms and I have two kind of users, which are redirected according to who they are... for exemple shop_keepers and clients...
Shop_keepers have to complete their profile with a picture of their shop...
So I've added all in my shop_keeper controller and views (new and show...)
Sorry if it's not very clear... Hope you see what I mean :D
You should spend a little time practicing... Maybe try going through all my 12 in 12 videos as well as my new courses and then take that knowledge and apply it to building your own project(s).
I think building a bunch of demo apps will help you get a feel for how things work a bit better :)
+Mackenzie Child thanks :) I will
How can I use paperclip gem into heroku server ?
+Mahmudul Haque Checkout my how to build a podcast course. I cover that in there: mackenziechild.me/podcast-network/
Thanks! Very helpful and simple!
+Orest Falchuk :)
Wow, thank you so much!
:)
Great tutorial. Thank you so much. Subscribed.
Awesome, thanks :)
Thanks Mackenzie!
joey k Sure thing :)
What a great tutorial. Truly awesome. :-)
I am using window 7, and i got this annoying error : Image has contents that are not what they are reported to be
Can any one help me
+Caohuu Quocminh I just solved this problem!
Install the exe by
download the exe from this link file.exe
test if is well installed by running your cmd and put the following instructions convert logo: logo.miff then run ' imdisplay logo.miff ' you will get custom logo image,that will pop up on your windows screen.
From here now you can start configuring everything on rails app
Open config/environments/development.rb
Add the following line: Paperclip.options[:command_path] = 'C:\tools\GnuWin32\bin'
If your rails server is currently running,brake the server and then run again rails s.After that you should be ready to go.Upload image on your app
thanks a lot mackenzie!
Can you possibly do a tutorial on video uploading? Say a remix of this video. If possible?
MrCortland12 Possibly at some point, just not sure when. But I will definitely add that to my list of ideas :)
Imagic magick doesn't work on dows. I gotta switch to os X or ubuntu. LOLs.
thanks man this is really AWESOME !!!!!!! :)
Thanks!! :)
On windows 8 it worked after restarted the computer.
hahaha!
Images are not displaying in my case
***** what to use for other uploads like office files
Newb question..... If I am allowing users to attach multiple images to a post, would you recommend generating an image model and then working that into my posts model? I found this for reference: bit.ly/1GpJtYa - I just didn't know how to work it into what I just did with this video without having previously creating an image model
Zach Ford Yeah I think you'd want to create an 'asset' (or images) model, then associate that with your posts model. Check out this StackOverflow for reference: stackoverflow.com/questions/24597721/rails-4-multiple-image-upload-using-paperclip
Mackenzie Child Bossman! Still figuring out multiple image upload... I'm guessing the same principles you outlined in the video would apply to comments? Like if I wanted a user to be able to attach 1 image per comment. The only hiccup I can see for me is that there is no comment_params set up in my app.
I'm going to try and play with this (multiple uploads) and try and do a video on it in the future!
Damn !!! that was easy man :D.. thank you.
+666999SYSTEM666 Glad it helped :)
this is is one of the best .................
+billa anand 🙌
I love the gem system for managing plugins I just hate some of the names some are cool like Capybara for testing but others need some work I was surprised to find a gem called cocaine in my gem list. apparently for commandline fu ... just a really bad choice. Pardon the pun.
Thanks, this was really useful! ;)
that's a nice video, and good part is that you uploaded kittens pictures :D
+Onica Adriana What other kind of pictures are there ;) Thanks
great! thank you!
Do a tutorial on slug urls :) I'm kinda tired of /name/id, doesn't look that user-friendly :p
That's a good idea, I'll add that to my list of ideas :)
Mackenzie Child You must have quite a long list now!
Djangokillen haha yes I do!