Skip to content

Commit f7796b8

Browse files
committed
Create stand-alone report
Not yet implemented in any objects
1 parent 3be6eeb commit f7796b8

3 files changed

Lines changed: 35 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
class ReportsController < ApplicationController
2+
before_action(:set_report, only: %i[show])
3+
4+
# GET /reports/1
5+
def show
6+
end
7+
8+
# GET /reports/genome/1
9+
def genome
10+
@object = Genome.find(params[:id])
11+
@crumbs = [
12+
['Genomes', genomes_url],
13+
[@genome.title(''), @genome],
14+
'Reports'
15+
]
16+
render('object', layout: !params[:content].present?)
17+
end
18+
19+
private
20+
21+
def set_report
22+
@report = Report.find(params[:id])
23+
end
24+
end
25+

app/views/reports/object.html.erb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<% @object.each do |reports| %>
2+
<div class="text-right muted-text">
3+
<%= time_ago_with_date(report.created_at, true) %>
4+
</div>
5+
<%= report.html.html_safe %>
6+
<hr/>
7+
<% end %>

config/routes.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@
209209
get :template
210210
end
211211
end
212+
namespace(:reports) do
213+
get 'genome/:id', to: 'report#genome'
214+
end
212215

213216
# General Application
214217
get 'link' => 'application#short_link'

0 commit comments

Comments
 (0)