问题
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