简体   繁体   中英

What is the best way to implement images into blog posts in ruby on rails?

I am building a blog website. After a user is logged in the user is able to create blog posts. On the blog index page there should be a thumbnail image of the blog post.

As user it would be nice if I could upload and implement images into the blog dynamically meaning I can freely decide where an image should be rendered in the blog post. I thought about using carrierwave and creating a images model.

I have not implemented a rich text editor like for example TinyMCE because I know I only can implement images with an image url on TinyMCE.

Is there a way to upload images and use it dynamicly within a form?

If the only reason you were not using TinyMCE was because you couldn't properly upload images but inserting an url, tinymce-rails-imageupload allows you to upload images within a post.

tinymce-rails-imageupload Github

And here's a tutorial about it where you can guide yourself through:

http://blog.active-bridge.com/how-to-implement-nice-image-uploader-to-tinymce

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM