Add UserAttribute model, suppose it will store user model want to use which attribute group
This commit is contained in:
1 parent
13065aa85a
commit
9f1de1b543
5 files changed
+32
-3
No files matched your search
@@ -3,4 +3,6 @@ class User
|
||||
|
||||
devise :authenticatable, :recoverable, :rememberable, :trackable
|
||||
|
||||
key :use_attributes
|
||||
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
class UserAttribute
|
||||
|
||||
include MongoMapper::Document
|
||||
|
||||
key :ident, String
|
||||
key_i18n :name, String
|
||||
key_i18n :attrs, Array
|
||||
|
||||
end
|
||||
@@ -8,16 +8,21 @@
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Attrs</th>
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
|
||||
<% @users.each do |user| %>
|
||||
<tr>
|
||||
<td><%= user.use_attributes.join(",") %></td>
|
||||
<td><%#= user.name %></td>
|
||||
<td><%= user.email %></td>
|
||||
<td><%= link_to 'Edit', edit_panel_user_path(user) %> | <%= link_to 'Destroy', panel_user_path(user), :method => :delete %></td>
|
||||
<td>
|
||||
<%= link_to 'Show', panel_user_path(user) %>
|
||||
<%= link_to 'Edit', edit_panel_user_path(user) %> |
|
||||
<%= link_to 'Destroy', panel_user_path(user), :method => :delete %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<% content_for :secondary do %>
|
||||
<ul class="list">
|
||||
<li><%= link_to t(:new_user, :scope => :panel), new_panel_user_path, :class => 'button positive' %></li>
|
||||
</ul>
|
||||
<% end -%>
|
||||
|
||||
<h1>Users panel</h1>
|
||||
|
||||
<%=h @user.name %>
|
||||
<%=h @user.email %>
|
||||
Reference in new issue
Block a user