Похоже, это . Печатная информация взята из созданной ниже таблицы. Я просто не могу понять, как остановить ее, не останавливая при этом печать таблицы.
Вот соответствующий код.
Мое представление индексадля файла проектов
<div class="jumbotron jumbotron-fluid bg-primary">
<div class="container">
<h1 class="display-4">Hochschule München Student Projects</h1>
<p class="lead">This website holds all the student led projects along with information about each of them.</p>
</div>
</div>
<div class="jumbotron jumbotron-fluid bg-primary">
<div class="container">
<h1 class="display-4">Hochschule München Student Projects</h1>
<p class="lead">This website holds all the student led projects along with information about each of them.</p>
</div>
</div>
<h1>Listing projects</h1>
<br>
Filter by Professor
<%= collection_select(:project, :project_professor, Project.all.select(:project_professor).uniq, :project_professor, :project_professor, prompt: true) %>
<br>
<table border="1">
<tr>
<th><%= sortable "project_title", "Project Title" %></th>
<th><%= sortable "project_professor", "Professor" %></th>
<th><%= sortable "project_partner", "Partner" %></th>
<th></th>
<th></th>
<th></th>
</tr>
<%= @projects.each do |project| %>
<tr>
<td><%= project.project_title %></td>
<td><%= project.project_professor%></td>
<td><%= project.project_partner%></td>
<td><%= link_to 'Show', project_path(project) %></td>
<td><%= link_to 'Edit', edit_project_path(project) %></td>
<td><%= link_to 'Destroy', project_path(project),
method: :delete,
data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</table>
<br>
<%= link_to 'New project', new_project_path %>
А вот и файл контроллера.
class ProjectsController < ApplicationController
helper_method :sort_column, :sort_direction
def index
@projects = Project.order(sort_column + " " + sort_direction); 0
end
def new
@project = Project.new
end
def create
@project = Project.new(project_params)
if @project.save
redirect_to @project
else
render 'new'
end
end
def edit
@project = Project.find(params[:id])
end
def update
@project = Project.find(params[:id])
if @project.update(project_params)
redirect_to @project
else
render 'edit'
end
end
def show
@project = Project.find(params[:id])
end
def destroy
@project = Project.find(params[:id])
@project.destroy
redirect_to projects_path
end
private
def project_params
params.require(:project).permit(:project_title, :project_semester, :project_partner, :project_professor, :project_format, :project_department, :project_description, :project_image, :project_link)
end
def sort_column
Project.column_names.include?(params[:sort]) ? params[:sort] : "project_title"
def sort_direction
%w[asc desc].include?(params[:direction]) ? params[:direction] : "asc"
end
end
Спасибо за любую помощь! У меня есть эта проблема в течение нескольких дней и не могу найти ошибку.