This commit is contained in:
Andreas Stephanides
2014-03-16 15:28:22 +01:00
parent 94778f0fa7
commit cbec643b96
5 changed files with 24 additions and 1 deletions

View File

@@ -12,6 +12,10 @@ class ThemengruppenController < ApplicationController
format.json { render json: @themengruppen } format.json { render json: @themengruppen }
end end
end end
def faqs
@themengruppen = Themengruppe.order(:priority).includes(:themen,{themen: :fragen})
end
# GET /themengruppen/1 # GET /themengruppen/1
# GET /themengruppen/1.json # GET /themengruppen/1.json

View File

@@ -3,7 +3,7 @@
<img class="media-object img" src="<%= lec_lva.picture.thumb.url unless lec_lva.picture.nil? %>"/> <img class="media-object img" src="<%= lec_lva.picture.thumb.url unless lec_lva.picture.nil? %>"/>
</a> </a>
<div class="media-body"> <div class="media-body">
<h4><%= link_to lec_lva.name, lec_lva %></h4> <h4><%= lec_lva.name %></h4>
Email: <%= mail_to lec_lva.email %><br> Email: <%= mail_to lec_lva.email %><br>
TISS: <%= link_to lec_lva.name, lec_lva.link, target: "_blank" %> TISS: <%= link_to lec_lva.name, lec_lva.link, target: "_blank" %>
</div> </div>

View File

@@ -0,0 +1,17 @@
<% @themengruppen.each do |tg| %>
<h2><%= tg.title%></h2>
<ul>
<% tg.themen.each do |t| %>
<li> <%= t.title %>
<ul>
<% t.fragen.each do |f| %>
<li><b> <%= f.title %></b><p> <%= f.text %></p></li>
<% end %>
</ul>
</li>
<% end %>
</ul>
<% end %>

View File

@@ -1,4 +1,5 @@
<div class="content-wrap content-column"> <div class="content-wrap content-column">
<p> <%= link_to "FAQS", faqs_themengruppen_path %></p>
<ul class="unstyled linkbox-list"> <ul class="unstyled linkbox-list">
<li> <li>
<% @themengruppen.each do |themengruppe| %> <% @themengruppen.each do |themengruppe| %>

View File

@@ -115,6 +115,7 @@ end
resources :themengruppen do resources :themengruppen do
get :verwalten get :verwalten
get :verwalten_all,:on=>:collection get :verwalten_all,:on=>:collection
get :faqs, :on=>:collection
post :sort_themen post :sort_themen
post :sort_themengruppen, :on=>:collection post :sort_themengruppen, :on=>:collection
resources :themen, :only=>[:new, :show] resources :themen, :only=>[:new, :show]