At the risk of venturing into the earlier view discussion, I have a
couple of questions about populating a data attributes.
I have a "main" view
<div class='small_index_card yellow_card todo_display ui-widget-
content draggable'>
<div class='todo_name'><p name="todo[name]">Test todo</p></div>
<div class='todo_content'><p name="todo[content]">SOme long content</
p></div>
<div class='todo_tags'><p name="todo[tag_collection]">tag1, tag2,
tag3</p></div>
<div class='todo_due_date'><p name="todo[due_date]">12-12-12</p></
div>
</div>
and in the controller...
if(user.todos.count > 0)
presenter.view.find('.small_index_card').repeat_for(user.todos)
end
As you can see it uses the pre 0.8 name attribute instead of scoping,
etc.
I need to track the
todo.id so I can delete, update, etc. I would like
to keep it in an attribute "data-card_id" and not expose it to the
user. So my questions.
1) Is keeping this kind of data in the data attribute field wrong?
2) How can I fill out this data-attribute? Via the binder? Or in the
controller's index action? How can I accomplish this with repeats?
p.s. if you prefer to see the full up code check out
http://github.com/nclaburn/curator