Module: Effective::Resources::Paths

Included in:
Effective::Resource
Defined in:
app/models/effective/resources/paths.rb

Instance Method Summary collapse

Instance Method Details

#controller_fileObject



72
73
74
# File 'app/models/effective/resources/paths.rb', line 72

def controller_file
  File.join('app/controllers', namespace.to_s, "#{plural_name}_controller.rb")
end

#datatable_fileObject



76
77
78
# File 'app/models/effective/resources/paths.rb', line 76

def datatable_file
  File.join('app/datatables', namespace.to_s, "#{plural_name}_datatable.rb")
end

#model_fileObject

Default file paths



68
69
70
# File 'app/models/effective/resources/paths.rb', line 68

def model_file
  File.join('app/models', class_path.to_s, "#{name}.rb")
end

#view_file(action = :index, partial: false) ⇒ Object



80
81
82
# File 'app/models/effective/resources/paths.rb', line 80

def view_file(action = :index, partial: false)
  File.join('app/views', namespace.to_s, (namespace.present? ? '' : class_path), plural_name, "#{'_' if partial}#{action}.html.haml")
end