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
activerecord perform_caching config affects collection caching 2019-12-05 21:46:02 +01:00
fixtures
lib
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