Ability for users to insert images into text area

45 views
Skip to first unread message

Colin Stodd

unread,
Apr 26, 2014, 2:01:24 PM4/26/14
to rubyonra...@googlegroups.com
So like many other beginners in Rails I'm following along to Michael Hartl's tutorial.  I'm nearing the end, and I'm thinking I would like to implement the ability for users (in the social network) to upload pics along with their comments and maybe even add a text editor type thing (not sure the correct term for this either)... ?  Can this be accomplished through a gem, and/or is this something a little advanced for a newbie like myself?  Really appreciate your feedback!

-Colin.

Robert Walker

unread,
Apr 28, 2014, 1:44:08 PM4/28/14
to rubyonra...@googlegroups.com
Colin Mr. wrote in post #1144182:
Text area (as in the <textarea> tag) has no support for image data. It
accepts plain text only. In order to upload images you need a <input
type="file"> along with adding the enctype="multipart/formdata"
attribute to the form tag (<form enctype="multipart/formdata" ...>).

There are gems to help you with this:

http://bcjordan.com/posts/rails-image-uploading-framework-comparison/

I've used Paperclip myself in the past, but have also heard good things
about Carrierwave.

--
Posted via http://www.ruby-forum.com/.

Colin Stodd

unread,
Apr 28, 2014, 9:34:59 PM4/28/14
to rubyonra...@googlegroups.com
Thanks, exactly what I was looking for!
Reply all
Reply to author
Forward
0 new messages