Sha256: efa249964eaf261bafecd25d9b4338db69578d95a67430333861cda6d1e4c32a

Contents?: true

Size: 515 Bytes

Versions: 4

Compression:

Stored size: 515 Bytes

Contents

class Todos::IndexView::TodoView < BaseView
  def template_data
    {
      partial: 'todos/index_view/todo',
      locals: {
        description: todo.description,
        done: done,
        edit_todo_path: view_context.edit_todo_path(todo),
        delete_todo_path: view_context.todo_path(todo),
        complete_todo_path: view_context.completed_todos_path(todo)
      }
    }
  end

  private

  def todo
    view_data.todo
  end

  def done
    if todo.done
      'Yes'
    else
      'No'
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
aldous-1.1.3 examples/basic_todo/app/views/todos/index_view/todo_view.rb
aldous-1.1.2 examples/basic_todo/app/views/todos/index_view/todo_view.rb
aldous-1.0.1 examples/basic_todo/app/views/todos/index_view/todo_view.rb
aldous-1.0.0 examples/basic_todo/app/views/todos/index_view/todo_view.rb