Sha256: 1425e18cc5c4cf943cba95e9b899653f326c72aa12d637d9adc7c333f5287156
Contents?: true
Size: 980 Bytes
Versions: 1
Compression:
Stored size: 980 Bytes
Contents
# Generates the class and view for a controller in a plugin's test application class PluginTestControllerGenerator < PluginAWeek::PluginTestHelper::Generator def manifest #:nodoc: record do |m| # Check for class naming collisions m.class_collisions class_path, "#{class_name}Controller", "#{class_name}Helper" # Controller and views directories m.directory File.join(plugin_app_root, 'app/controllers', class_path) m.directory File.join(plugin_app_root, 'app/views', class_path, file_name) # Controller class m.template 'controller.rb', File.join(plugin_app_root, 'app/controllers', class_path, "#{file_name}_controller.rb") # View template for each action actions.each do |action| path = File.join(plugin_app_root, 'app/views', class_path, file_name, "#{action}.html.erb") m.template 'view.html.erb', path, :assigns => {:action => action, :path => path} end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
plugin_test_helper-0.1.6 | generators/plugin_test_controller/plugin_test_controller_generator.rb |