Rails also makes a counter variable available within a partial called by the collection, named after the member of the collection followed by _counter. For example, if you're rendering @products, within the partial you can refer to product_counter to tell you how many times the partial has been rendered. This does not work in conjunction with the as: :value option.
根据这里说的不可以使用 as,但是我把 as 去掉了,还是不行。
You need to Sign in before reply, if you don't have an account, please Sign up first.