ruby - How to make private and public user's fields in rails? -
i want give public , private options fields user. suppose, want make private "birth date" field, should not appeared on detail page other user.
i have customized registration controller in devise. fields saving ,updating , showing don't know how hide private fields other users. confused how start????
if have method e.g. current_user
(current logged in user, if use e.g. devise) can like
<%= @user.birth_date if @user == current_user %>
Comments
Post a Comment