Ruby on Rails Monday, April 28, 2014

Thanks, exactly what I was looking for!

On Monday, April 28, 2014 1:44:08 PM UTC-4, Ruby-Forum.com User wrote:
Colin Mr. wrote in post #1144182:
> 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!

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/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5cb43936-0e77-46db-b59b-4020c96d198f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment