I am building my e-commerce website and have chosen Spree for it. I am in need of having custom admin features other than what spree provides.
For example, I would like to have a new tab in the admin panel. In that panel I need to do some configuration.
Ex: A tab that will allow me to feature a specific product ( ex: cake of the week )
I went through the documentation. But couldn't find any such feature. Is it possible?
I am new to both Spree and Ruby. I come primarily from a PHP/.NET background. Ruby so far has surprised me and is cool.
Updates:
Deface seems to be the way to go for the operation as @gmacdougall suggested. I am still trying out Deface but have so far failed.
For a test, I am attempting to remove the nav
tag and add <h1>Hello!</h1>
instead.
Deface::Override.new(
:virtual_path => 'admin/shared/_menu',
:name => 'custom-admin-tab',
:replace => "nav",
#:partial => "spree/admin/shared/custom_tabs"
:text => '<h1>This is the new NAV</h1>'
)
Looking in to the console, I don't see any thing new happening when the following code is entered in app\overrides\custom-admin-tab.rb
file.
But the interesting thing is, when I change the :virtual_path
to :virtual_path => 'admin/shared/_tabs'
, Deface shows up and says there were no matches for 'tab'. I tried it with some other files but nothing showed up.
Am I doing some thing wrong?
spree/admin/shared/_menu
– Ziyan Junaideen