Topic: tinymce-rails-imageupload

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.

Last edited by Begler (2012-04-02 12:36:17)