Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (16 sloc) 318 Bytes
class TodosController < ApplicationController
def index
@todos = current_user.todos
end
def new
@todo = Todo.new
end
def create
@todo = Todo.new(params[:todo].merge(owner: current_user.email_address))
if @todo.save
redirect_to todos_path
else
render :new
end
end
end
Jump to Line
Something went wrong with that request. Please try again.