Erwin Rooijakkers Erwin Rooijakkers - 5 months ago 27x
Ruby Question

How to override/change lay-out of Ruby on Rails spree app after installing Bootstrap gem?

I have a Spree Commerce application with the spree_bootstrap gem installed by adding

gem 'spree_bootstrap', github: 'jdutil/spree_bootstrap'

to the Gemfile.

Now on the main page I have all the familiar bootstrap divs as
<div class="container row">
<ul id="main-nav-bar" class="inline">

I am new to Rails and I want to change the lay-out masterpage by adding my own custom navbar and other tweaks. Unfortunately application.html.rb is a virtually empty page and I don't think that is the one to make changes.

My question is: how do I override or change the standard div values? I do not have the files locally. I've heard about using Deface as a tool, but I don't know how to use it.

I hope someone here can provide some more insight on changing the standard bootstrap Spree application.


Create the file app/views/spree/layouts/spree_application.html.erb. Copy and paste this content then edit as you wish :)

Repeat for any other Spree views and partials that you might want to restyle. If you'd like to know the paths you need to create & the content for a certain view or partial, check out the app/views/spree folder of their GitHub repo.

You might need to restart your server before seeing any changes.