how to change the role name as we edit the name of role in devise

邮差的信 提交于 2019-12-13 20:50:56

问题


I have model user from devise

 belongs_to :role

Here i want to save the id of role name in database so that if first the role is guests is involve to many user. Later on if admin edit the guests to guest then problem occurs. so

<% if can? :manage, @users %>
<%= f.collection_select :role_id,Role.all, :id, :name ,:prompt => 'Select Role'%> 
<% end%>

like this to work. How can i do? as i did like this in other model but in user model of devise it its not working,

来源:https://stackoverflow.com/questions/13681227/how-to-change-the-role-name-as-we-edit-the-name-of-role-in-devise

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!