Skip to content

Commit

Permalink
changes in users index close #3
Browse files Browse the repository at this point in the history
  • Loading branch information
maxhansson committed Jul 25, 2014
1 parent 3b2f62c commit 5e8b729
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/models/purchase.rb
Expand Up @@ -28,7 +28,7 @@ class Purchase < ActiveRecord::Base
belongs_to :to_warehouse, class_name: 'Warehouse'
belongs_to :parent, polymorphic: true
has_many :purchase_items
has_many :documents, as: :parent
has_many :documents, as: :parent, :dependent => :delete_all
has_many :to_transaction, class_name: 'ProductTransaction', as: :parent

accepts_nested_attributes_for :purchase_items
Expand Down
18 changes: 8 additions & 10 deletions app/views/users/index.html.haml
Expand Up @@ -3,18 +3,16 @@
%table{:class => 'table table-striped'}
%thead
%tr
%th Email
- if can? :manage, Role
%th
%th
%th
%th= t(:user)
%th= t(:email)
%th
%th
%tbody
- @users.each do |user|
%tr
%td #{link_to(user.email, user)}
- if can? :manage, Role
%td #{link_to 'Roles', edit_roles_user_path(user)}
%td= link_to settings_icon, edit_user_path(user)
%td= delete_button_for user
%td= user.name
%td= user.email
%td= link_to settings_icon, user_path(user)
%td= delete_button_for user

= paginate @users, :theme => 'twitter-bootstrap-3'

0 comments on commit 5e8b729

Please sign in to comment.