Created
July 21, 2015 17:02
-
-
Save alexggordon/820020aab934bf192b81 to your computer and use it in GitHub Desktop.
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
// react code | |
render() { | |
let delta = this.props.delta ? ( | |
<strong className={this.props.delta > 0 ? 'text-success' : 'text-danger'}> | |
{this.props.delta} | |
</strong> | |
) : null; | |
return ( | |
<div className='card'> | |
{delta} | |
{this.props.title} | |
</div> | |
); | |
} | |
# ruby code | |
<div class='card'> | |
<%= content_tag_for(:strong, :class => @delta > 0 ? 'text-success' : 'text-danger' ) do %> | |
<%= @this_props_title %> | |
<% end %> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment