Sha256: 6cf4562829882f34542b2554735a993af0ae23fb18509490b87511f2f156c233
Contents?: true
Size: 750 Bytes
Versions: 3
Compression:
Stored size: 750 Bytes
Contents
require 'rails/generators/named_base' module Coalla module Cms class CreateMarkupGenerator < Rails::Generators::NamedBase argument :name, type: :string, default: "" source_root File.expand_path('../templates', __FILE__) def copy_controller_file template 'controllers/markup_controller.rb.erb', 'app/controllers/markup_controller.rb' empty_directory 'app/views/markup' end def setup_routes sentinel = /namespace :admin do\s*$/ routing_code = <<EOF scope controller: :markup, as: :markup, path: 'markup' do get :lot end EOF in_root do inject_into_file 'config/routes.rb', "\n #{routing_code}", {after: sentinel} end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems