Sha256: ecac26b9eb762243ad8b5c54d638b693eba55aed9e5a44b74345d24187ab31ad

Contents?: true

Size: 383 Bytes

Versions: 2

Compression:

Stored size: 383 Bytes

Contents

class Todos::IndexView < BaseView
  def template_data
    {
      template: 'todos/index',
      locals: {
        todo_views: todo_views,
      }
    }
  end

  private

  def todos
    view_data.todos
  end

  def todo_views
    todos.map do |todo|
      todo_view(todo)
    end
  end

  def todo_view(todo)
    view_builder.build(Todos::IndexView::TodoView, todo: todo)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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