This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def show | |
authorize! :assignment, :show | |
@assignment = Assignment.find(params[:id]) | |
@related_logs = @assignment.assignment_logs.page(params[:page]).per(4).order('assignment_logs.date DESC').includes(:user) | |
# do a find to find and order candidates by there current employment | |
@candidates = AssignmentList.where('assignment_lists.assignment_id = ?', @assignment.id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# AJAX request: This adds line items to cart. | |
def add_line_item_to_cart | |
#Get current_cart object | |
current_cart | |
quantity = params[:quantity].to_i | |
id = params[:id].to_i | |
line_item = LineItem.find_or_create_by_cartridge_id_and_cart_id(id, current_cart.id) | |
line_item.quantity = line_item.quantity.to_i + quantity |