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 }
end
protected
def collection
@article_categories = ArticleCategory.order('name')
end
end

View file

@ -3,15 +3,17 @@
%p= link_to "Neue Kategorie anlegen", new_article_category_path, class: 'btn btn-primary'
%table.table.table-striped
%tr
%th Name
%th Beschreibung
%th
- for article_category in ArticleCategory.all
%tr{:class => cycle("even","odd", :name => 'category')}[article_category]
%td= article_category.name
%td= article_category.description
%td
= 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'
%thead
%tr
%th Name
%th Beschreibung
%th
%tbody
- @article_categories.each do |article_category|
%tr
%td= article_category.name
%td= article_category.description
%td
= 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'