Move StockArticle#history to StockArticle#show
This commit is contained in:
parent
a3e82f5304
commit
fef8c6d99f
8 changed files with 42 additions and 49 deletions
|
|
@ -31,6 +31,11 @@ class StockitController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def show
|
||||
@stock_article = StockArticle.find(params[:id])
|
||||
@stock_changes = @stock_article.stock_changes.order('stock_changes.created_at DESC')
|
||||
end
|
||||
|
||||
def destroy
|
||||
@article = StockArticle.find(params[:id])
|
||||
@article.mark_as_deleted
|
||||
|
|
@ -55,9 +60,4 @@ class StockitController < ApplicationController
|
|||
|
||||
render :partial => 'form', :locals => {:stock_article => stock_article}
|
||||
end
|
||||
|
||||
def history
|
||||
@stock_article = StockArticle.undeleted.find(params[:stock_article_id])
|
||||
@stock_changes = @stock_article.stock_changes.order('stock_changes.created_at DESC').each {|s| s.readonly!}
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
%tbody
|
||||
- for article in @stock_articles
|
||||
%tr{:class => stock_article_classes(article), :id => "stockArticle-#{article.id}"}
|
||||
%td=h article.name
|
||||
%td= link_to article.name, article
|
||||
%td= article.quantity
|
||||
%td= article.quantity - article.quantity_available
|
||||
%th= article.quantity_available
|
||||
|
|
@ -56,7 +56,6 @@
|
|||
%td= article.article_category.name
|
||||
%td
|
||||
= link_to t('ui.edit'), edit_stock_article_path(article), class: 'btn btn-mini'
|
||||
= link_to t('ui.history'), stock_article_history_path(article), class: 'btn btn-mini'
|
||||
= link_to t('ui.delete'), article, :method => :delete, :confirm => t('.confirm_delete'),
|
||||
class: 'btn btn-mini btn-danger', :remote => true
|
||||
%p
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue