Class: Admin::ThemesController

Inherits:
Spree::Admin::BaseController
  • Object
show all
Defined in:
app/controllers/admin/themes_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

Selected Theme name is written into sandbox/config/*.yml file



9
10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/admin/themes_controller.rb', line 9

def create
  system "echo theme: \\'#{params[:option]}\\' >  #{Rails.root}/config/multi_theme_settings.yml"
  if Rails.env == "production"
   system "touch #{Rails.root}/tmp/restart.txt"
   flash[:notice] = "Store Panel layout is Changed as #{params[:option]}"
  else
    load File.expand_path("../../../../config/initializers/load_config.rb", __FILE__)
    flash[:notice] = "Store Panel layout is Changed as #{params[:option]} Please restart your server"
  end
  redirect_to "/admin/themes/new"
end

#newObject

To select your theme



4
5
6
# File 'app/controllers/admin/themes_controller.rb', line 4

def new
  @options=THEME_OPTIONS["options"].split(' ')
end