$ rails g model User
belongs_to
has_one
<?php // /app/Http/Middleware/Cors.php | |
namespace App\Http\Middleware; | |
use Closure; | |
class Cors { | |
public function handle($request, Closure $next) | |
{ | |
return $next($request) |
# Example 1. | |
<div class="col-md-8 blog--caja-right"> | |
{% set imageblog = { | |
'#theme': 'image_style', | |
'#style_name': 'despliegue_blog', | |
'#uri': node.field_image.entity.uri.value, | |
'#attributes': { class: 'img-responsive' }, | |
} %} | |
{{ imageblog }} |
############################################# | |
# Push de la rama actual | |
git push origin $rama_actual | |
############################################# | |
# Volver a un commit anterior, descartando los cambios | |
git reset --HARD $SHA1 | |
############################################# | |
# Ver y descargar Ramas remotas |
{this.state.screen === 'list' && ( | |
<ListContacts | |
contacts={this.state.contacts} | |
onDeleteContact={this.removeContact} | |
/> | |
)}; | |
{this.state.screen === 'create' && ( | |
<CreateContact /> | |
)} |
/* Combining .filter() and .map() | |
* | |
* Using the musicData array, .filter, and .map(): | |
* - filter the musicData array down to just the albums that have | |
* sold over 1,000,000 copies | |
* - on the array returned from .filter(), call .map() | |
* - use .map() to return a string for each item in the array in the | |
* following format: "<artist> is a great performer" | |
* - store the array returned form .map() in a new "popular" variable | |
* |
/* Using .filter() | |
* | |
* Using the musicData array and .filter(): | |
* - return only album objects where the album's name is | |
* 10 characters long, 25 characters long, or anywhere in between | |
* - store the returned data in a new `results` variable | |
* | |
* Note: | |
* - do not delete the musicData variable | |
* - do not alter any of the musicData content |
/* Using .map() | |
* | |
* Using the musicData array and .map(): | |
* - return a string for each item in the array in the following format | |
* <album-name> by <artist> sold <sales> copies | |
* - store the returned data in a new albumSalesStrings variable | |
* | |
* Note: | |
* - do not delete the musicData variable | |
* - do not alter any of the musicData content |