Skip to content

Instantly share code, notes, and snippets.

<span className = {(this.state.isActive) ? 'non-active' : 'active'} onClick={this.ToggleClass} > One </span>
<span className = {(!this.state.isActive) ? 'non-active' : 'active'} onClick={this.ToggleClass} > Two </span>
<span className = {(this.state.isActive) ? 'non-active' : 'active'} onClick={this.ToggleClass} > One </span>
ToggleClass = (e) =>{
this.setState({ isActive: !this.state.isActive });
}
$('span').click( e =>{
$(e.target).toggleClass('non-active');
} );
.active{
Text-decoration : underline;
Cursor: pointer
}
.non-active{
Text-decoration: none;
Cursor: normal
}
@sochetanie
sochetanie / gist:339073b8d8f7cd6b80d3840359660c34
Created October 24, 2017 20:38 — forked from arjunvenkat/gist:1115bc41bf395a162084
Seeding a Rails database with a CSV file

How to seed a Rails database with a CSV file

1. Setup

First, Create a folder inside of lib called seeds

Put your CSV file example.csv into the lib/seeds folder. In the example below, the file is called real_estate_transactions.csv

Make sure you've created a resource with the appropriate columns to match your seed data. The names don't have to match up.