Create a sample existing website to which a validation login page will be added later.
rails g scaffold Grade last_name:string first_name:string course_number:string credit_hours:integer grade:stringRun the rake command.
Directions for adding a validation login page:
rails g model LoginInfo username:string password:stringRun the rake command.
rake db:seed
rails g controller Login login_page
if !session[:logged_in]
redirect_to :controller => 'login',
:action => 'login_page'
return
end
For the index, show, new, and destroy methods, place this code directly
before the linerespond_to do |format|In the edit method, place it at the end of the method, directly before the final end statement
<hr />
<%= form_tag :controller => 'login',
:action => 'logout' do %>
<%= submit_tag 'Logout', :class => 'ctrl' %>
<% end %>
post "login/login_page" post "login/logout"