Skip to content

Instantly share code, notes, and snippets.

@laspluviosillas
Created July 11, 2012 01:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laspluviosillas/3087439 to your computer and use it in GitHub Desktop.
Save laspluviosillas/3087439 to your computer and use it in GitHub Desktop.
class InventoriesController < ApplicationController
before_filter :authenticate_login!
def index
@page_title = "Course Administration"
@inventories = Inventory.where(:account_id => current_account.id)
.joins(:course)
.select("inventories.*, courses.name as course_name")
end
def show
@inventory = Inventory.find(params[:id], :joins => :course, :select => "inventories.*, courses.name as course_name")
@page_title = "Assign Units to " + @inventory.course_name
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment