Method: Spina::InstallGenerator#set_theme
- Defined in:
- lib/generators/spina/install_generator.rb
#set_theme ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/generators/spina/install_generator.rb', line 37 def set_theme account = ::Spina::Account.first return if account.theme.present? && !no?("Theme '#{account.theme} is set. Skip? [Yn]") theme = begin theme = account.theme || themes.first theme = ask("What theme do you want to use? (#{themes.join('/')}) [#{theme}]").presence || theme end until theme.in? themes account.update_attribute(:theme, theme) end |