Nettoyage des appels map, pour utiliser la syntaxe &:
This commit is contained in:
parent
ef0f237f60
commit
cc8369a0f8
@ -2,7 +2,7 @@
|
|||||||
class TagsController < InheritedResources::Base
|
class TagsController < InheritedResources::Base
|
||||||
def index
|
def index
|
||||||
@tags = Event
|
@tags = Event
|
||||||
.pluck(:tags).map { |e| e.split }.flatten
|
.pluck(:tags).map(&:split).flatten
|
||||||
.group_by { |i| i }
|
.group_by { |i| i }
|
||||||
.map { |k, v| [k, v.size] }
|
.map { |k, v| [k, v.size] }
|
||||||
.reject { |_k, v| v < 2 }
|
.reject { |_k, v| v < 2 }
|
||||||
|
@ -3,7 +3,7 @@ module EventsHelper
|
|||||||
def set_events_meta
|
def set_events_meta
|
||||||
set_meta_tags \
|
set_meta_tags \
|
||||||
description: t('layouts.application.subtitle'),
|
description: t('layouts.application.subtitle'),
|
||||||
keywords: @events.map { |e| e.tags }.join(' ').split.group_by { |i| i }
|
keywords: @events.map(&:tags).join(' ').split.group_by { |i| i }
|
||||||
.reject { |_k, v| v.size < 2 }.map { |k, _v| k },
|
.reject { |_k, v| v.size < 2 }.map { |k, _v| k },
|
||||||
DC: {
|
DC: {
|
||||||
title: t('layouts.application.title'),
|
title: t('layouts.application.title'),
|
||||||
|
Loading…
Reference in New Issue
Block a user