Skip to content

Commit 338222b

Browse files
committed
added no-layout option
1 parent 1121b6b commit 338222b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ You can specify the template engine with `--engine=name` option, where name can
3939

4040
If you want to generate the stylesheets of a specific theme without changing the previously generated layout you can pass the `--no-layout` option:
4141

42-
script/generate theme --theme=bec --no_layout
42+
rails g web_app_theme:theme --theme=bec --no-layout
4343

4444

4545
You can specify the text used in the header with the `--app-name` option:

lib/generators/web_app_theme/theme/theme_generator.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ class ThemeGenerator < Rails::Generators::Base
44

55
argument :layout_name, :type => :string, :default => 'application'
66

7-
class_option :theme, :type => :string, :default => :default, :desc => 'Specify the layout theme'
8-
class_option :app_name, :type => :string, :default => 'Web App', :desc => 'Specify the application name'
9-
class_option :engine, :type => :string, :default => 'erb', :desc => 'Specify the template engine'
7+
class_option :theme, :type => :string, :default => :default, :desc => 'Specify the layout theme'
8+
class_option :app_name, :type => :string, :default => 'Web App', :desc => 'Specify the application name'
9+
class_option :engine, :type => :string, :default => 'erb', :desc => 'Specify the template engine'
10+
class_option :no_layout, :type => :boolean, :default => false, :desc => 'Use this option if you want to generate only stylesheets'
1011

1112
def copy_layout
13+
return if options.no_layout
1214
admin_layout_name = "layout_admin.html.erb"
1315
case options.engine
1416
when 'erb'

0 commit comments

Comments
 (0)