Skip to content
Snippets Groups Projects
Commit 1c573c81 authored by Matheus Agio Nerone's avatar Matheus Agio Nerone
Browse files

fix welcome controller, fix view

parent b068b205
No related branches found
No related tags found
No related merge requests found
......@@ -11,14 +11,10 @@ class WelcomeController < ApplicationController
repository.for(:learning_object).find(id)
end
@Subjects = repository.for(:subject).all.take(8)
@Subjects.delete_if do |subject|
if subject.highlights.nil? || subject.highlights.empty?
true
end
end
@Subjects = repository.for(:subject).all
@Subjects.delete_if{|s| not s.highlights.present?}
@Subjects.each do |subject|
object = repository.for(:learning_object).find(subject.highlights.first)
subject.highlights
end
end
......
......@@ -66,8 +66,8 @@
<% @Subjects.each do |subject|%>
<div class="col-sm-4">
<div class="row">
<h4><b><%= subject["name"] %></b></h4>
<%= render 'shared/application/object_vertical', object: subject["first_highlight"] %>
<h4><b><%= subject.name %></b></h4>
<%= render subject.highlights.first, orientation: 'vertical'%>
<p>
<a href="#">Ver Mais</a>
</p>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment