Skip to content

Add .reverse_each support to bindings #166

@RickCarlino

Description

@RickCarlino
module Main
  class MainController < Volt::ModelController
    private
    def send_msg
      store._logs << {text: store._msg}
      store._msg = ""
    end
  end
end
  <form e-submit="send_msg">
    <input type="text" value="{{ store._msg }}">
  </form>

<ul>
    {{ store._logs.reverse_each do |log| }}
    <li>{{ log._text }}</li>
    {{ end }}
  </ul>

This code will load after a change happens to the collection, but not on page load. using each does not have the same issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions