Beruflich Dokumente
Kultur Dokumente
5 points)
a)
b)
c) Will send the input data to a login function indicated by the router
Question 2 options:
True
False
Save
Question 3 (0.5 points)
True
False
Save
Question 4 (0.5 points)
True
False
Save
Question 5 (0.5 points)
is so that the password that is input came be accessed by other controllers in the project
Question 5 options:
a) True
b) False
The line will always fail because the condition User.authenticate has no
definition in the program
This line requires that either the userid or the password must be
authenticated by the User.authenticate method
Save
a)
Sends the user back to the home page so that he/she can click on
the login link again
b)
Sends the user back to the home page so that he/she can click on
the maintenance link again
c)
From this point on during that session the logged in user can access any
most but not all restricted pages without loggin in again
From this point on during that session the logged in user without
logging in cannot access the public pages of the website but must only
Without knowing exactly the userid and password of the user one
cannot tell
Save
The code
if user = find_by_userid(userid)
if user.password == password
has two equal signs (==) because this is a test of logical equivalence, not numeric equality and the CPU
does a string match function to determine the answer
Question 11 options:
True
False
Save
Question 12 (0.5 points)
The code:
if user = find_by_userid(userid)
if user.password == password
user
end
end
contains a double if condition but it still can be described as a simple match process matchin the input
password and userid to those in the table User
Question 12 options:
True
False
Save
Question 13 (0.5 points)
Even though this code has been put into a method for the model User we still have to create a controller to
execute this code
Question 13 options:
True
False
Save
Question 14 (0.5 points)
This code is found in the model for a table User which will hold the userids and passwords for the authorized
users.
Question 14 options:
True
False
Save
Question 15 (0.5 points)
end
end
succeeds it returns the variable 'user'
This variable will then be used by what other part of the program
Question 15 options:
This is telling the router that if for instance a "login" is requested, it will find this function as in
the sessions controller and should display the "new" view.
Question 17 options:
True
False
Save
Question 18 options:
Would be produced in the router by the original
rails g controller displaygudies guidesout
def tripin
end
def guideout
tripname= params[:trip_name_in]
@trip_name_out = tripname
trip_out = Trip.find_by_name(tripname)
@guide_list = trip_out.guides
end
end
In the routes.rb we find:
get "displayguides/tripin"
post "displayguidies/tripin"
get "displayguides/guideout"
post"displayguides/guideout"
Only the post"displayguides/guideout" is necessary in the routes.rb
Question 19 options:
True
False
Save
Tells the router to look in the start folder for the file path to the users
root folder.
Tells the router that the first controller and view to be execuated upon a
browser request is the
"starter#home"
Tells the router after executing the "starter#home" the program should
start over again.
Save
Previous PageNext Page