Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TodosController < ApplicationController
- def index
- @todos = Todo.all
- end
- def update
- end
- def new
- @todo = Todo.new
- end
- def create
- @todo = Todo.new (todo_params)
- @todo.project_id = params[:todo_params]
- if @todo.save
- redirect_to root_path
- else
- render root_path
- end
- end
- private def todo_params
- params.require(:todo).permit(:text, :isCompleted, :project_id)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement