lib/generators/scrivito/install/install_generator.rb in scrivito_sdk-1.0.0 vs lib/generators/scrivito/install/install_generator.rb in scrivito_sdk-1.1.0.rc1

- old
+ new

@@ -70,8 +70,20 @@ def copy_image_widget_files copy_file 'app/models/image_widget.rb' copy_file 'app/views/image_widget/show.html.erb' copy_file 'app/views/image_widget/thumbnail.html.erb' end + + def append_scrivito_routes + log :route, "Appending Scrivito routes" + definition = "\n"\ + " # Default Scrivito routes. Adapt them to change the routing of CMS objects.\n"\ + " # See the documentation of 'scrivito_route' for a detailed description.\n"\ + " scrivito_route '/', using: 'homepage'\n"\ + " scrivito_route '(/)(*slug-):id', using: 'slug_id'\n"\ + " scrivito_route '/*permalink', using: 'permalink', format: false\n"\ + + inject_into_file 'config/routes.rb', definition, before: /^end\s*\z/, verbose: false + end end end end