Skip to content

Instantly share code, notes, and snippets.

@alexggordon
Created July 21, 2015 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexggordon/820020aab934bf192b81 to your computer and use it in GitHub Desktop.
Save alexggordon/820020aab934bf192b81 to your computer and use it in GitHub Desktop.
// 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