<file_sep># Be sure to restart your server when you modify this file.

ScaffoldingTodo::Application.config.session_store :cookie_store, key: '_Scaffolding_Todo_session'
<file_sep>class UsersController < ApplicationController

  before_filter :authenticate_user!

  private

  def correct_user
    @user = User.find_by_id(params[:id])
    redirect_to(root_path) unless current_user?(@user)
  end

 

end<file_sep>module SessionsHelper1


  def current_user?(user)
    current_user==user
  end

  def correct_user(user_id)
    @user = User.find(user_id)
    redirect_to root_path unless current_user?(@user)
  end

end<file_sep>json.extract! @todo, :id, :todo_item, :created_at, :updated_at
<file_sep>todoapp
=======

Intention:
  - A user could sign up and sign in
  - A user can cread a new ToDo
  - A user can see only his own ToDos
  - A user can mark a ToDo as "done"
   
Bonus:
  - A user can see all his own todos and mark one as done on a single page by js/ajax
  - There is ActiveAdmin as an admin Interface to manage all Todos of all users

Requirements:
  - Devise should be use for loggin in and registration
  - A User "A" can not see ToDos of user "B"