class Effective::Generators::ControllerGenerator
Public Instance Methods
assign_actions()
click to toggle source
# File lib/generators/effective/controller_generator.rb, line 24 def assign_actions @actions = invoked_actions end
assign_attributes()
click to toggle source
# File lib/generators/effective/controller_generator.rb, line 28 def assign_attributes @attributes = invoked_attributes.presence || resource.belong_tos_attributes.merge(resource_attributes) self.class.send(:attr_reader, :attributes) end
create_controller()
click to toggle source
# File lib/generators/effective/controller_generator.rb, line 37 def create_controller if admin_effective_scaffold? template "#{scaffold_path}/controllers/controller.rb", resource.admin_effective_controller_file else template "#{scaffold_path}/controllers/controller.rb", resource.controller_file end end
invoke_controller()
click to toggle source
# File lib/generators/effective/controller_generator.rb, line 33 def invoke_controller say_status :invoke, :controller, :white end
validate_resource()
click to toggle source
# File lib/generators/effective/controller_generator.rb, line 20 def validate_resource exit unless resource_valid? end