This file contains hidden or 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
| Imagine you have a blog website. | |
| - Model and controller description: please refer to https://kitt.lewagon.com/knowledge/tutorials/css_advanced_form_checkboxes | |
| - Sometimes, you may want to update an existing post to change its categories for instance. | |
| - Let's us the collection_check_boxes Rails helper to design nice checkboxes in an edit view. | |
| Refer to Rails documentation: https://apidock.com/rails/v4.0.2/ActionView/Helpers/FormOptionsHelper/collection_check_boxes | |
| 1. HTML: |
This file contains hidden or 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
| import React, { Component } from 'react'; | |
| import { bindActionCreators } from 'redux'; | |
| import { connect } from 'react-redux'; | |
| import { $ACTION } from '../actions'; | |
| class $LIST_CONTAINER extends Component { | |
| componentWillMount() { | |
| this.props.$ACTION(); | |
| } |