I want to add the last link video to Spree Admin panel under Product. How I could go ahead and make this feature.
I would appreciate any help.
Thank you
I want to add the last link video to Spree Admin panel under Product. How I could go ahead and make this feature.
I would appreciate any help.
Thank you
You can create a spree extension or use one of your already existing extensions. In the extension's
models/spree
directory create a model filevideo.rb
.You then have to decorate
Spree Core
models affected by your new video model. For example yourSpree Product
model. In your extension'smodels/spree
directory create a product model decoratorproduct_decorator.rb
.You can do this for any other spree core models associated with your video model.
In your extension's
controllers/spree/admin
you have to createvideos_controller.rb
. I suggest you take a look at spree backend images_controller for directions on how you can add this controller. If you plan to upload the videos to your application, you might need anaudio/video
transcoder such as paperclip-av-transcoder.You will also have to deface
spree/backend/app/views/spree/admin/products/new.html.erb
andspree/backend/app/views/spree/admin/products/edit.html.erb
to add the video addition and removal functionalities. I do not know the structure and complexity of your application and therefore this is not a definite answer but a direction on how you can achieve what you want.`