Some additional upload options

Usually we need some alignment options: Left, Center or Right.
Styles can be passed for the drop-down via (in the form):

<code>
<%= tinymce(uploadimage_hint: @article.id, styles: {med: "Medium (354px)", small: "Small (120x80)"}) %>
</code>

And the Alt for the image.

Need to add the corresponding fields to the image (or asset) model you wanted to use.

Here's a sample controller implementation:

<pre></code>
class Admin::TinymceAssetsController < ApplicationController
  before_filter :require_admin
  
  def create
    if params[:hint] #associate it to the article
      @article = Article.find(params[:hint])
      image = @article.images.new(:asset => params[:file])
      image.alt = params[:alt]
      image.default_size = params[:default_size]
      image.alignment = params[:alignment]
      if image.save
        render json: {
          image: {
            url: image.try(:asset).try(:url, :small)
          }
        }, content_type: "text/html"
      else
        #image could not be saved
      end
    else
      #no association
    end
  end
end
</code></pre>