Hi. I have a beginner level. And I can not get the image url (i do not
know how).
https://github.com/Atlantia/tinymce-rails-imageupload
Create
name = params[:file].original_filename
directory = "public/data"
#create the file path
path = File.join(directory, name)
#write the file
File.open(path, "wb") { |f| f.write(params[:file].read) }
Render
image: {
url: view_context.image_url(image)
}
File is saved, but I do not know how to get the url ...
thanks for the help.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment