How to pre-check checkboxes in formtastic
- by trustfundbaby
I have a form I'm trying to set up ...
Users can have many posts, and each post can have many people watching it.
The Watch model is set up polymorphically as 'watchable' so it can apply to different types of models. It has a user_id, watchable_id, watchable_type and timestamps as attributes/fields.
This is soley so that when people comment on a post, users watching the post can get an email about it.
What I'm trying to do is show the user a list of users that they can tag on each post, which is not problem. This is what I'm using right now
http://pastie.org/940421
The problem with this, is that when you go to edit an update/post ... all the checkboxes are prechecked ... I want it to pre-check only users who are currently watching the post.