<h1><%= @project.title %></h1>

<% if is_professor? %>
	<h3><%= @project.remaining_time %> hours remaining</h3>
	<% if @project.remaining_time < 0 %>
	<div id="errors">
		<h4>over budget</h4>
	</div>
	<% end %>
<% elsif is_student? %>
	<h3><%= @student_total_hours %> hours worked on this project</h3>
<% end %>

<h3><%= @project.hypothesis %></h3>


<p><%= @project.summary %></p>
<p>Status: <%= @project.status %></p>

<% @project.records.each do |record| %>
	<%= record.student.name%><br>
	<%= record.observations %><br>
	<% if is_professor? %>
		<%= record.hours_worked%> hours worked<br><br>
	<% end %> 
<% end %>

<% if is_student? %>
	<%= form_for @record , html: {class: "form-group"} do |f| %>
	  <%= f.hidden_field :project_id, value: @project.id %>
	  <%= f.label :hours_worked %>
	  <%= f.number_field :hours_worked %><br>
	  <%= f.label :observations %>
	  <%= f.text_area :observations, cols: 30, rows: 15%><br>
	  <%= f.submit %>
	<% end %>
<% end %>
<h1><%= @project.title %></h1>

<% if is_professor? %>
	<h3><%= @project.remaining_time %> hours remaining</h3>
	<% if @project.remaining_time < 0 %>
	<div id="errors">
		<h4>over budget</h4>
	</div>
	<% end %>
<% elsif is_student? %>
	<h3><%= @student_total_hours %> hours worked on this project</h3>
<% end %>

<h3><%= @project.hypothesis %></h3>

<p><%= @project.summary %></p>
<p>Status: <%= @project.status %></p>

<%= render :"shared/errors" %>
<% @project.records.each do |record| %>
	<%= record.student.name%><br>
	<%= record.observations %><br>
	<% if is_professor? %>
		<%= record.hours_worked%> hours worked<br><br>
	<% end %> 
<% end %>

<% if is_student? %>
	<%= form_for @record , html: {class: "form-group"} do |f| %>
	  <%= f.hidden_field :project_id, value: @project.id %>
	  <%= f.label :hours_worked %>
	  <%= f.number_field :hours_worked %><br>
	  <%= f.label :observations %>
	  <%= f.text_area :observations, cols: 30, rows: 15%><br>
	  <%= f.submit %>
	<% end %>
<% end %>
Add errors to the project show page for when records are created
Add errors to the project show page for when records are created
