Sha256: 643b6af1b7c600ca610bac42ec50a7b9b36e95f63663cdd7d68bb8a7f1cae69c
Contents?: true
Size: 990 Bytes
Versions: 12
Compression:
Stored size: 990 Bytes
Contents
class ComponentGenerator < ScaffoldGenerator def manifest record do |m| # Check for class naming collisions. m.class_collisions(class_name) # Controller, views, test and stylesheets directories. m.directory(File.join('spec','factories')) m.directory(File.join('app','views','components')) m.directory(File.join('app','views','admin','components')) m.template( "model.rb", File.join('app','models',"#{controller_file_name.singularize}.rb") ) m.template( "template.html.erb", File.join('app','views','components', "#{controller_file_name.singularize}.html.erb") ) m.template( "admin_template.html.erb", File.join('app','views','admin','components', "_#{controller_file_name.singularize}.html.erb") ) m.template( "factory.rb", File.join('spec','factories',"#{controller_file_name.singularize}.rb") ) end end end
Version data entries
12 entries across 12 versions & 1 rubygems