Filtering by Multiple Attributes

@users = User.allrender json: @users, except: [:username, :password_digest, :created_at, :updated_at],include: [:days]
state = {curl_pattern: "2a",curl_type: "wavy",porosity: "low",density: "thin",width: "thin"}
<h3>Filter by Hair Type</h3><form> <label>Curl Pattern</label><select name="curl_pattern" id='curlPattern'value={this.state.curl_pattern} onChange={this.handleFormChange}><option value="2a">2A</option><option value="2b">2B</option><option value="2c">2C</option><option value="3a">3A</option><option value="3b">3B</option><option value="3c">3C</option><option value="4a">4A</option><option value="4b">4B</option><option value="4c">4C</option> </select>
handleFormChange = event => {this.setState({[event.target.name]: event.target.value});}
curlPatternFilter() {if(this.props.users[9]){ return(this.props.users.filter(user => user.curl_pattern === this.state.curl_pattern && user.curl_type === this.state.curl_type && user.porosity === this.state.porosity && user.density === this.state.density && user.width === this.state.width))}}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store