Class: Kryptonite::BasicsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/kryptonite/basics/basics_generator.rb

Instance Method Summary collapse

Instance Method Details

#generate_filesObject



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/generators/kryptonite/basics/basics_generator.rb', line 7

def generate_files
  puts "*** WARNING - Generating basic content and asset files. Make sure you have backed up any files before overwriting them. ***"
  generate "model Content content_key:string body:text"
  generate "kryptonite:scaffold Content content_key:string body:text"
  generate "model Asset content_id:integer file_file_name:string file_content_type:string file_file_size:integer file_updated_at:datetime"
  generate "kryptonite:scaffold Asset content_id:integer file_file_name:string"
  
  #contents controller
  copy_file "app/controller/kryptonite/contents_controller.rb", "app/helpers/kryptonite/config_helper.rb"

end