Sha256: 5f234af8461ddb6987519937eb703a5d308a2b6d49419b6e71ae2cb7573ef394
Contents?: true
Size: 820 Bytes
Versions: 5
Compression:
Stored size: 820 Bytes
Contents
module Vision module Generators class ResourceGenerator < Rails::Generators::Base source_root File.expand_path("../../templates", __FILE__) argument :resource_name, :type => :string desc "Creates a vision resource_controller" def create_resource_controller template 'resource_controller.rb.erb', "app/controllers/vision/#{resource_name.tableize}_controller.rb" end def add_route_to_vision_namespace inject_into_file 'config/routes.rb', "resources :#{resource_name.tableize}\n",after: "# vision routes\n" end def add_menu_item inject_into_file 'config/vision_navigation.rb', "\nprimary.item :#{resource_name}, '#{resource_name}', vision_#{resource_name.tableize}_path\n", after:"navigation.items do |primary|\n" end end end end
Version data entries
5 entries across 5 versions & 1 rubygems