class Effective::Generators::ViewsGenerator

Public Instance Methods

assign_attributes() click to toggle source
# File lib/generators/effective/views_generator.rb, line 23
def assign_attributes
  @attributes = (invoked_attributes.presence || resource_attributes).except(:archived)
  self.class.send(:attr_reader, :attributes)
end
create_views() click to toggle source
# File lib/generators/effective/views_generator.rb, line 32
def create_views
  if invoked_actions.include?('show') || non_crud_actions.present?
    template 'views/_resource.html.haml', resource.view_file(resource.name, partial: true)
  end
end
invoke_views() click to toggle source
# File lib/generators/effective/views_generator.rb, line 28
def invoke_views
  say_status :invoke, :views, :white
end
validate_resource() click to toggle source
# File lib/generators/effective/views_generator.rb, line 19
def validate_resource
  exit unless resource_valid?
end