Small fixes for article_categories.

This commit is contained in:
benni 2012-11-10 16:51:30 +01:00
parent 0236fb5a60
commit 181695d1bd
2 changed files with 20 additions and 12 deletions

View File

@ -12,4 +12,10 @@ class ArticleCategoriesController < ApplicationController
update!(:notice => "Die Kategorie wurde aktualisiert") { article_categories_path } update!(:notice => "Die Kategorie wurde aktualisiert") { article_categories_path }
end end
protected
def collection
@article_categories = ArticleCategory.order('name')
end
end end

View File

@ -3,15 +3,17 @@
%p= link_to "Neue Kategorie anlegen", new_article_category_path, class: 'btn btn-primary' %p= link_to "Neue Kategorie anlegen", new_article_category_path, class: 'btn btn-primary'
%table.table.table-striped %table.table.table-striped
%tr %thead
%th Name %tr
%th Beschreibung %th Name
%th %th Beschreibung
- for article_category in ArticleCategory.all %th
%tr{:class => cycle("even","odd", :name => 'category')}[article_category] %tbody
%td= article_category.name - @article_categories.each do |article_category|
%td= article_category.description %tr
%td %td= article_category.name
= link_to "Bearbeiten", edit_article_category_path(article_category), class: 'btn btn-mini' %td= article_category.description
= link_to "Löschen", article_category, :method => :delete, :confirm => 'Are you sure?', %td
class: 'btn btn-mini btn-danger' = link_to "Bearbeiten", edit_article_category_path(article_category), class: 'btn btn-mini'
= link_to "Löschen", article_category, :method => :delete, :confirm => 'Are you sure?',
class: 'btn btn-mini btn-danger'