class Effective::Generators::DatatableGenerator
Public Instance Methods
Source
# File lib/generators/effective/datatable_generator.rb, line 25 def assign_attributes @attributes = invoked_attributes.presence || resource_attributes(all: true) self.class.send(:attr_reader, :attributes) end
Source
# File lib/generators/effective/datatable_generator.rb, line 34 def create_datatable unless defined?(EffectiveDatatables) say_status(:skipped, :datatable, :yellow) and return end with_resource_tenant do if admin_effective_scaffold? template "#{scaffold_path}/datatables/datatable.rb", resource.admin_effective_datatable_file elsif effective_scaffold? template "#{scaffold_path}/datatables/datatable.rb", resource.effective_datatable_file else template "#{scaffold_path}/datatables/datatable.rb", resource.datatable_file end end end
Source
# File lib/generators/effective/datatable_generator.rb, line 30 def invoke_datatable say_status :invoke, :datatable, :white end
Source
# File lib/generators/effective/datatable_generator.rb, line 21 def validate_resource exit unless resource_valid? end