This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends 'master' %} | |
{% block section %} | |
<div class="contentDiv"> | |
<div class="input-group input-group-lg inputSearch"> | |
<span class="input-group-addon" id="sizing-addon1"><i class="fa fa-search"></i></span> | |
<input type="text" class="form-control" placeholder="Buscar" aria-describedby="sizing-addon1"> | |
</div> | |
<div> | |
{% for company in companies %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const Route = use('Route') | |
const Helpers = use('Helpers') | |
Route.resource('/companies', 'CompanyController') | |
Route.get('/companies/:company', function (request, response) { | |
response.download(Helpers.storagePath('img/companies/' + request.param('company'))) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const Company = use('App/Model/Company') | |
const Category = use('App/Model/Category') | |
* index(request, response) { | |
let companies = yield Company.with('categories').fetch() | |
yield response.sendView('companies', {companies: companies.toJSON()} | |
} |