{"action":"opened","issue":{"url":"https://api.github.com/repos/steven-Zzz/rails-v2ex/issues/1","repository_url":"https://api.github.com/repos/steven-Zzz/rails-v2ex","labels_url":"https://api.github.com/repos/steven-Zzz/rails-v2ex/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/steven-Zzz/rails-v2ex/issues/1/comments","events_url":"https://api.github.com/repos/steven-Zzz/rails-v2ex/issues/1/events","html_url":"https://github.com/steven-Zzz/rails-v2ex/issues/1","id":261269891,"number":1,"title":"注册用户的时候，需要加上用户的一些其他信息，如username等等。","user":{"login":"steven-Zzz","id":7447957,"avatar_url":"https://avatars3.githubusercontent.com/u/7447957?v=4","gravatar_id":"","url":"https://api.github.com/users/steven-Zzz","html_url":"https://github.com/steven-Zzz","followers_url":"https://api.github.com/users/steven-Zzz/followers","following_url":"https://api.github.com/users/steven-Zzz/following{/other_user}","gists_url":"https://api.github.com/users/steven-Zzz/gists{/gist_id}","starred_url":"https://api.github.com/users/steven-Zzz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steven-Zzz/subscriptions","organizations_url":"https://api.github.com/users/steven-Zzz/orgs","repos_url":"https://api.github.com/users/steven-Zzz/repos","events_url":"https://api.github.com/users/steven-Zzz/events{/privacy}","received_events_url":"https://api.github.com/users/steven-Zzz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-28T10:31:38Z","updated_at":"2017-09-28T10:31:38Z","closed_at":null,"author_association":"OWNER","body":"之前的做法是，在config/initializers/devise.rb里面修改**config.authentication_keys**，这样的话，虽然也可以，但是这样的话，每次登录的时候也都要输入你增加的字段。\r\n\r\n现在的做法：1，重构registrations的controller，然后在create这个action里面，加入\r\n**devise_parameter_sanitizer.permit(:sign_up, keys: [:username])**，然后再super。\r\n完整代码：\r\n`    def create\r\n      devise_parameter_sanitizer.permit(:sign_up, keys: [:username])\r\n      super\r\n    end\r\n`\r\n这样就可以实现。"}}
{"actor":{"display_login":"steven-Zzz"}}