{"action":"created","issue":{"url":"https://api.github.com/repos/smpallen99/ex_admin/issues/25","labels_url":"https://api.github.com/repos/smpallen99/ex_admin/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/smpallen99/ex_admin/issues/25/comments","events_url":"https://api.github.com/repos/smpallen99/ex_admin/issues/25/events","html_url":"https://github.com/smpallen99/ex_admin/issues/25","id":127059141,"number":25,"title":"How to setup many to many?","user":{"login":"tispratik","id":80631,"avatar_url":"https://avatars.githubusercontent.com/u/80631?v=3","gravatar_id":"","url":"https://api.github.com/users/tispratik","html_url":"https://github.com/tispratik","followers_url":"https://api.github.com/users/tispratik/followers","following_url":"https://api.github.com/users/tispratik/following{/other_user}","gists_url":"https://api.github.com/users/tispratik/gists{/gist_id}","starred_url":"https://api.github.com/users/tispratik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tispratik/subscriptions","organizations_url":"https://api.github.com/users/tispratik/orgs","repos_url":"https://api.github.com/users/tispratik/repos","events_url":"https://api.github.com/users/tispratik/events{/privacy}","received_events_url":"https://api.github.com/users/tispratik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-01-16T22:51:14Z","updated_at":"2016-01-18T14:36:18Z","closed_at":null,"body":"Hello,\r\n\r\nI have a user model and a site model. Users can belong to many sites and a sites can have many users. So, i have a `user_site` model. When i add a user, i need to associate him/her with a site. Can you suggest how to do it? The following did not work for me.\r\n\r\n```elixir\r\nregister_resource Myapp.User do\r\n  form user do\r\n    inputs do\r\n      input user, :name\r\n      input user, :email\r\n    end\r\n\r\n    inputs :user_sites do\r\n      input user, :site_id\r\n    end\r\n  end\r\nend\r\n```\r\n\r\nuser_site.ex\r\n```elixir\r\ndefmodule Myapp.UserSite do\r\n  use Myapp.Web, :model\r\n\r\n  schema \"user_sites\" do\r\n    timestamps\r\n\r\n    belongs_to :user, Myapp.User\r\n    belongs_to :site, Myapp.Site\r\n  end\r\nend\r\n```"},"comment":{"url":"https://api.github.com/repos/smpallen99/ex_admin/issues/comments/172542945","html_url":"https://github.com/smpallen99/ex_admin/issues/25#issuecomment-172542945","issue_url":"https://api.github.com/repos/smpallen99/ex_admin/issues/25","id":172542945,"user":{"login":"tispratik","id":80631,"avatar_url":"https://avatars.githubusercontent.com/u/80631?v=3","gravatar_id":"","url":"https://api.github.com/users/tispratik","html_url":"https://github.com/tispratik","followers_url":"https://api.github.com/users/tispratik/followers","following_url":"https://api.github.com/users/tispratik/following{/other_user}","gists_url":"https://api.github.com/users/tispratik/gists{/gist_id}","starred_url":"https://api.github.com/users/tispratik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tispratik/subscriptions","organizations_url":"https://api.github.com/users/tispratik/orgs","repos_url":"https://api.github.com/users/tispratik/repos","events_url":"https://api.github.com/users/tispratik/events{/privacy}","received_events_url":"https://api.github.com/users/tispratik/received_events","type":"User","site_admin":false},"created_at":"2016-01-18T14:36:18Z","updated_at":"2016-01-18T14:36:18Z","body":"Great, thanks!"}}