Sha256: 759ed7fb1e7d68c247fb30794e54611e06f8b63ad5c209d6bba45e5358101cc8
Contents?: true
Size: 777 Bytes
Versions: 1
Compression:
Stored size: 777 Bytes
Contents
class Rails::Generator::Commands::Create def draw_routes file_start = 'ActionController::Routing::Routes.draw do |map|' unless options[:pretend] gsub_file 'config/routes.rb', /(#{Regexp.escape(file_start)})/mi do |match| "#{match}\n map.slightcms_pages '/:path', :controller => :slightcms_pages, :action => :show\n" end end end end class SlightcmsSetupGenerator < Rails::Generator::Base def manifest record do |m| # Setup directories m.directory('public/slightcms/assets') # Setup migration file m.migration_template('migrate/slightcms_setup_migration.rb', 'db/migrate') # Setup routes in routes.rb # m.draw_routes end end def file_name "slightcms_setup" end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
slightcms-0.0.11 | generators/slightcms_setup/slightcms_setup_generator.rb |