website_controller.rb
require 'digest-sha2" should be require 'digest/sha2'
register action
@title = 'Website Example -- Login Page' should be
@title = 'Website Example -- Register Page'
Login.save should be login.save
redirect_to :action -> 'login' should be
redirect_to :action => 'login'
login action
dbpw = a[1].passwd should be dbpw = a[0].passwd
hash = Digest:SHA2.hexdigest(passwd) should be
hash = Digest::SHA2.hexdigest(passwd)
if dbpw = hash should be if dbpw == hash
session[isloggedin] = true should be
session[:isloggedin] = true
index action
session[isloggedin] = false
logout action
end is missing at the end of the method.
register.html.erb
<%= form_tag :action => 'register' %> should be
<%= form_tag :action => 'register' do %>
The
tag after the password_field_tag should be
style="r" should be class="r" in the td tags.
The end table tag is missing at the end of the table.
<% end %> is missing at the end of the view.
login.html.erb
<%= f.text_field_tag :username, '', should be
| <%= text_field_tag :username, '',
| <%= password_field_tag password, '' should be
| <%= password_field_tag :password, ''
<%= link 'Registration Page' :action => 'login' should be
<%= link_to 'Registration Page', :action => 'register' %>
index.html.erb
<%= submit_tag 'Logout', :style => 'ctrl' %> should be
<%= submit_tag 'Logout', :class => 'ctrl' %>
website.html.erb
@title should be
<%= @title %>
The end head and body tags should be switched.
yield :layout should be
<%= yield :layout %>
The end html tag is missing.
style.css
font-family; Verdana: size: 110%; } should be
font-family: Verdana; font-size: 110%; }
.ctrl ( fontfamily: Verdana; height: 0.3in; width:2.5in; )
should be
.ctrl { font-family: Verdana; height: 0.3in; width:2.5in; }
|