Sha256: 032830cdaea7897970d90cbd71163fa22fd4c1d684a70467632579d8305bb6f1

Contents?: true

Size: 298 Bytes

Versions: 2

Compression:

Stored size: 298 Bytes

Contents

class TodosController::Index < BaseAction
  def default_view_data
    super.merge({todos: todos})
  end

  def perform
    return build_view(Home::ShowRedirect) unless current_user

    build_view(Todos::IndexView)
  end

  private

  def todos
    Todo.where(user_id: current_user.id)
  end
end


Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
aldous-1.0.1 examples/basic_todo/app/controller_actions/todos_controller/index.rb
aldous-1.0.0 examples/basic_todo/app/controller_actions/todos_controller/index.rb