Added pages_controller and index.html.erb for views/pages

parent 4003bdcf
class PagesController < ApplicationController
def index
@positions = Position.all
render "pages/index.html.erb"
end
end
\ No newline at end of file
......@@ -8,6 +8,13 @@
</head>
<body>
<% if user_signed_in? %>
<p>You are logged in as <%= current_user.email %>.</p> <br> || <%= link_to "Log Out", destroy_user_session_path, method: :delete %>
<% else %>
<%= "" %>
<% end %>
<%= link_to "Homepage", root_path %>
<%= yield %>
</body>
......
<h1>Official Election Ballot</h1>
<% if user_signed_in? %>
<h2>Please take a look at our candidates!</h2>
<hr>
<% else %>
<h4>You are not signed in. Please <%= link_to "Login", new_user_session_path %> or <%= link_to "Sign Up", new_user_registration_path %> to proceed with voting.</h2>
<% end %>
\ No newline at end of file
......@@ -2,4 +2,5 @@ Rails.application.routes.draw do
devise_for :users
resources :positions
resources :candidates
root to: "pages#index"
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment