cleaning routes
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
class GremienController < ApplicationController
|
||||
# GET /gremien
|
||||
# GET /gremien.json
|
||||
def index
|
||||
def verwalten
|
||||
@gremien = Gremium.all
|
||||
@gremientabs=Gremium.all
|
||||
respond_to do |format|
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
class NeuigkeitenController < ApplicationController
|
||||
before_filter {@toolbar_elements=[]}
|
||||
load_and_authorize_resource
|
||||
def index
|
||||
@neuigkeiten = Neuigkeit.all
|
||||
end
|
||||
#def index
|
||||
# @neuigkeiten = Neuigkeit.all
|
||||
#end
|
||||
|
||||
|
||||
def show
|
||||
@neuigkeit = Neuigkeit.find(params[:id])
|
||||
if can? :edit, @neuigkeit
|
||||
@toolbar_elements << {:text=>I18n.t('common.edit'),:path=>edit_neuigkeit_path(@neuigkeit),:icon=>:pencil}
|
||||
@toolbar_elements << {:hicon=>'icon-remove-circle', :text=> I18n.t('common.delete'),:path => neuigkeit_path(@neuigkeit), :method=> :delete,:confirm=>"Sure?" }
|
||||
@toolbar_elements << {:hicon=>'icon-plus', :text=> "publish",:path => neuigkeit_publish_path(@neuigkeit),:confirm=>"Sure?" }
|
||||
@toolbar_elements << {:text=>I18n.t('common.edit'),:path=>edit_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:icon=>:pencil}
|
||||
@toolbar_elements << {:hicon=>'icon-remove-circle', :text=> I18n.t('common.delete'),:path => rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit), :method=> :delete,:confirm=>"Sure?" }
|
||||
@toolbar_elements << {:hicon=>'icon-plus', :text=> "publish",:path => publish_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:confirm=>"Sure?" }
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
<h1>Listing gremien</h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Desc</th>
|
||||
<th>Typ</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
<% @gremien.each do |gremium| %>
|
||||
<tr>
|
||||
<td><%= gremium.name %></td>
|
||||
<td><%= gremium.desc %></td>
|
||||
<td><%= gremium.typ %></td>
|
||||
<td><%= link_to 'Show', gremium %></td>
|
||||
<td><%= link_to 'Edit', edit_gremium_path(gremium) %></td>
|
||||
<td><%= link_to 'Destroy', gremium, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
|
||||
<%= link_to 'New Gremium', new_gremium_path %>
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
<%= link_to neuigkeit do %>
|
||||
<%= link_to [neuigkeit.rubrik,neuigkeit] do %>
|
||||
<div class="media">
|
||||
<div class="pull-left" href="#">
|
||||
<p><br><%= image_tag neuigkeit.picture.thumb.url unless neuigkeit.picture.url.nil? %></p>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<p><br><%= link_to image_tag(@neuigkeit.picture.big_thumb.url),@neuigkeit.picture.url %></p>
|
||||
</div>
|
||||
<div class="media-body">
|
||||
<h1><%= link_to @neuigkeit.title,neuigkeit_path(@neuigkeit) %></h1>
|
||||
<h1><%= link_to @neuigkeit.title,rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit) %></h1>
|
||||
<%= raw(@neuigkeit.text) %>
|
||||
<p></p>
|
||||
</div>
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can? :verwalten, Rubrik%>
|
||||
<% if request.fullpath == rubriken_verwalten_path %>
|
||||
<% if request.fullpath == verwalten_rubriken_path %>
|
||||
<li class="active pull-right">
|
||||
<% else %>
|
||||
<li class="pull-right">
|
||||
<% end %>
|
||||
<%= link_to "Verwaltung", rubriken_verwalten_path %>
|
||||
<%= link_to "Verwaltung", verwalten_rubriken_path %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user