How to re-use Spree Image uploading system in another model?
<p>I am learning ruby on rails (Version 4.2).
I am working on spree making a web commerce.
I have to make a Inspiration page which will contain description(globalize system), a video link, published_on and multiple images.
I don't go to use paperclip/carrierwave gem or other gem. </p>

<p>I want to use spree product image uploading system. I have made a Inspiration Model and Inspiration_images model.</p>

<p>Inspiration.rb</p>

<pre><code>class Inspiration &lt; ActiveRecord::Base
  validates :video_link, presence: true # validation for video attributes
  # attributes for description field with globalize
  translates :description
  globalize_accessors locales: [:en, :de, :fr], attributes: [:description]
# iamges
  has_many :images, -&gt; { order(:position) }, as: :viewable, dependent: :destroy, class_name: "Spree::Image"

  # scopes for inspiration
  scope :publishable, -&gt; { where('published_on &lt;= ?', Time.zone.today) }
end
</code></pre>

<p>Inspiration_images.rb:</p>

<pre><code>class InspirationImage &lt; ActiveRecord::Base
  belongs_to :inspiration
end
</code></pre>

<p>But now, How to make a form and controller(create method) regarding using this model ?
I want to make this as like as Spree Image uploading system.
Please help me.</p>