Add StockChanges index
This commit is contained in:
parent
d397132f7b
commit
ef62a18ac9
9 changed files with 59 additions and 1 deletions
|
|
@ -99,6 +99,11 @@ class ApplicationController < ActionController::Base
|
|||
@supplier = Supplier.find(params[:supplier_id]) if params[:supplier_id]
|
||||
end
|
||||
|
||||
# Get stock_article in nested resources
|
||||
def find_stock_article
|
||||
@stock_article = StockArticle.undeleted.find(params[:stock_article_id])
|
||||
end
|
||||
|
||||
# Set config and database connection for each request
|
||||
# It uses the subdomain to select the appropriate section in the config files
|
||||
# Use this method as a before filter (first filter!) in ApplicationController
|
||||
|
|
|
|||
8
app/controllers/stock_changes_controller.rb
Normal file
8
app/controllers/stock_changes_controller.rb
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#encoding: utf-8
|
||||
class StockChangesController < ApplicationController
|
||||
before_filter :find_stock_article
|
||||
|
||||
def index
|
||||
@stock_changes = @stock_article.stock_changes(:readonly => true).order('stock_changes.created_at DESC')
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue