1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionview/test
Joel Hawksley f24734a7e1
Introduce class_names helper
As a follow-up to https://github.com/rails/rails/pull/37872,
this change introduces a class_names view helper
to make it easier to conditionally apply class names
in views.

Before:
<div class="<%= item.for_sale? ? 'active' : '' %>">

After:
<div class="<%= class_names(active: item.for_sale?) %>">

We've been using this helper in the GitHub monolith
since 2016.

Co-authored-by: Aaron Patterson <tenderlove@github.com>
2019-12-09 16:41:18 -07:00
..
actionpack Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
activerecord perform_caching config affects collection caching 2019-12-05 21:46:02 +01:00
fixtures Fix partial caching ignore repeated items issue 2019-04-04 09:59:06 +08:00
lib Fix rubocop violations 2019-06-14 23:32:15 +09:00
template Introduce class_names helper 2019-12-09 16:41:18 -07:00
ujs update https urls [ci skip] 2019-10-03 11:01:32 +02:00
abstract_unit.rb Remove needless require "pp" 2019-11-06 22:50:53 +09:00
active_record_unit.rb Run actionview tests in parallel 2019-06-05 18:40:08 -07:00