voltrb / volt

A Ruby web framework where your Ruby runs on both server and client
MIT License
3.22k stars 196 forks source link

Event Bindings can't handle model attributes #273

Closed dennym closed 9 years ago

dennym commented 9 years ago

Still trouble with accessing object attributes in a e-click event like described couple of days ago on gitter.

I did a compare with 0.9.4 and latest master. Just clone this and do a bundle and on the index page add some objects with the button. On the list below each list item has a e-click event which assigns the id of the object to the params on click for testing purpose. https://github.com/dennym/event-binding-trouble

(I have added both config/base/index.html files since they are different in 0.9.4 and latest master)

In 0.9.4 it works as expected. The object id gets assigned to the params. On latest master instead it returns something like #<Method:0x1220> This happens to all different use cases. Also when you want to do something like e-click="dosomething(object.id)" and inspect the option inside of the method.

Another strange behavior is when you try it with built in user model it works fine and as expected on both versions.

ryanstout commented 9 years ago

I think I know what the issue here is. Fixing... Didn't realize you were on master.