spree-guides
spree-guides copied to clipboard
uninitialized constant Spree::MyApp
NameError: uninitialized constant Spree::MyApp
~/Projects/shop/config/initializers/shop.rb:3:in <module:Spree>' ~/Projects/shop/config/initializers/shop.rb:2:in
<top (required)>'
The example of the site wide preferences does not work. Where am i to define the Spree::MyApp::Config class?
module Spree Spree::MyApp::Config = Spree::MyApplicationConfiguration.new end
Spree::MyApp::Config[:theme] = "blue_theme" Spree::MyApp::Config[:show_spash_page] = true Spree::MyApp::Config[:number_of_articles] = 5
MyApp
is only an example. Could you please show us where in what guide says to do this?
Of corse it is an example, but this class has be definded somewhere, even if i give it a different name. Where would i put it?
It is in the preference guide: https://github.com/spree/spree-guides/blob/master/content/developer/core/preferences.md Line 283
It's most likely a bad example. What it should be is YourApplicationName
, which matches the name inside config/application.rb
.