Skip to content

Commit

Permalink
Fixing documentation and code issue #211
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed Fadel authored and Mohamed Fadel committed Apr 22, 2014
1 parent 22cad5c commit c210134
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions tutor/app/controllers/hints_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ class HintsController < ApplicationController

@@answer_id = nil

# [Adding Helping Hints - 4.12]
# Creates a new record to Hint Table
# Parameters:
#[Adding Helping Hints - 4.12]
#Creates a new record to Hint Table
#Parameters:
# owner_id: ID of the hint owner
# owner type: type of hint owner
# category: states whether it is a hint or tip
# Returns:
#Returns:
# Redirects to edit page on success, refreshes on failure
# Author: Mohamed Fadel
#Author: Mohamed Fadel
def create
p = Hint.new(permitCreate)
if lecturer_signed_in?
Expand All @@ -33,26 +33,27 @@ def create
end
end

# [Adding Helping Hints - 4.12]
# Passes the input of the form as paramaters for create action to use it
# Parameters:
#[Adding Helping Hints - 4.12]
#Passes the input of the form as paramaters for create action to use it
#Parameters:
# submission_counter: hint's submission counter
# message: hint's message
# Returns: params to create action
# Author: Mohamed Fadel
#Returns:
# params to create action
#Author: Mohamed Fadel
def permitCreate
params.require(:Hint).permit(:submission_counter, :message)
end

# [Delete a Hint - Story 4.21]
# This action takes the hint id, remove it from the database
# and then redirects the user to the edit page accompanied
# with a "Hint deleted" message.
# Parameters:
#[Delete a Hint - Story 4.21]
#This action takes the hint id, remove it from the database
#and then redirects the user to the edit page accompanied
#with a "Hint deleted" message.
#Parameters:
# params[:id]: The current hint's id
# Returns:
#Returns:
# none
# Author: Mohamed Fadel
#Author: Mohamed Fadel
def destroy
hint = Hint.find_by_id(params[:id])
hint.destroy
Expand Down

2 comments on commit c210134

@mohamedfadel
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ahmed-Moataz Fixed.

@mohamedfadel
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.