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
'use strict'; | |
import AppContainer from '../todoApp/containers/AppContainer'; | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import '../todoApp/assets/base.css'; | |
ReactDOM.render(<AppContainer />, document.getElementById('todoapp')); |
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
<section id="todoapp"></section> | |
<footer id="info"> | |
<p>Double-click to edit a todo</p> | |
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p> | |
</footer> | |
<%= javascript_pack_tag 'todoApp' %> | |
<%= stylesheet_pack_tag 'todoApp' %> |
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
import * as Immutable from 'immutable'; | |
const Todo = Immutable.Record({ | |
id:'', | |
complete:false, | |
text:'', | |
}); | |
export default Todo; |
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
def get_all | |
@todos = Todo.all | |
render json: @todos | |
end | |
def create | |
@todo = Todo.create(todo_params) | |
respond_to do |format| | |
format.json do |
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
/** | |
* Created by zarko on 7/2/17. | |
*/ | |
'use strict'; | |
import * as jQuery from 'jquery'; | |
import * as Immutable from 'immutable'; | |
import TodoActionTypes from './TodoActionTypes'; | |
import TodoDispatcher from './TodoDispatcher'; |
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
Rails.application.routes.draw do | |
root 'todos#index' | |
resources :todos, only: [:index, :create, :update, :destroy] do | |
member do | |
put :toggle | |
end | |
collection do |
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
'user strict' | |
import {ReduceStore} from 'flux/utils'; | |
import TodoDispatcher from './TodoDispatcher'; | |
import TodoActionTypes from './TodoActionTypes'; | |
class TodoErrorsStore extends ReduceStore { | |
constructor(){ | |
super(TodoDispatcher); |