lib/generators/weeler/install_generator.rb in weeler-0.0.3 vs lib/generators/weeler/install_generator.rb in weeler-0.0.4
- old
+ new
@@ -31,16 +31,25 @@
#def install_models
# copy_files 'models', 'app/models'
#end
- #def install_views
- # copy_files 'views', 'app/views'
- #end
+ def install_views
+ copy_files 'views', 'app/views'
+ end
- #def install_controllers
- # copy_files 'controllers', 'app/controllers'
- #end
+ def install_controllers
+ copy_files 'controllers', 'app/controllers'
+ end
+
+ class_option :routes, :desc => "Generate routes", :type => :boolean, :default => true
+ def add_weeler_routes
+ weeler_routes = "mount_weeler_at \"weeler\" do \n"
+ weeler_routes << " # weeler_resources :example, include_in_weeler_menu: true \n"
+ weeler_routes << " end"
+ route weeler_routes
+ end
+
private
def copy_files subdir, dest_dir
raise ArgumEnterror unless subdir.is_a? String