diff --git a/app/controllers/glossary_categories_controller.rb b/app/controllers/glossary_categories_controller.rb
new file mode 100644
index 0000000..0f0f289
--- /dev/null
+++ b/app/controllers/glossary_categories_controller.rb
@@ -0,0 +1,56 @@
+class GlossaryCategoriesController < ApplicationController
+
+ before_action :find_category_from_id, only: [:show, :edit, :update, :destroy]
+
+ def index
+ @categories = GlossaryCategory.all
+ end
+
+ def show
+ end
+
+ def new
+ @category = GlossaryCategory.new
+ end
+
+ def edit
+ end
+
+ def create
+ category = GlossaryCategory.new(glossary_category_params)
+ if category.save
+ flash[:notice] = l(:notice_successful_create)
+ redirect_to category
+ end
+ end
+
+ def update
+ @category.attributes = glossary_category_params
+ if @category.save
+ flash[:notice] = l(:notice_successful_update)
+ redirect_to @category
+ end
+ rescue ActiveRecord::StaleObjectError
+ flash.now[:error] = l(:notice_locking_conflict)
+ end
+
+ def destroy
+ @category.destroy
+ redirect_to glossary_categories_path
+ end
+
+ # Find the category whose id is the :id parameter
+ def find_category_from_id
+ @category = GlossaryCategory.find(params[:id])
+ rescue ActiveRecord::RecordNotFound
+ render_404
+ end
+
+ private
+
+ def glossary_category_params
+ params.require(:glossary_category).permit(
+ :name
+ )
+ end
+end
diff --git a/app/helpers/glossary_categories_helper.rb b/app/helpers/glossary_categories_helper.rb
new file mode 100644
index 0000000..23a7306
--- /dev/null
+++ b/app/helpers/glossary_categories_helper.rb
@@ -0,0 +1,2 @@
+module GlossaryCategoriesHelper
+end
diff --git a/app/views/glossary_categories/_form.html.erb b/app/views/glossary_categories/_form.html.erb
new file mode 100644
index 0000000..9d6d0ba
--- /dev/null
+++ b/app/views/glossary_categories/_form.html.erb
@@ -0,0 +1,3 @@
+
+
<%= form.text_field :name, size: 60, required: true %>
+
diff --git a/app/views/glossary_categories/edit.html.erb b/app/views/glossary_categories/edit.html.erb
new file mode 100644
index 0000000..a69491d
--- /dev/null
+++ b/app/views/glossary_categories/edit.html.erb
@@ -0,0 +1,7 @@
+<%=l :label_glossary_category %> $<%= @category.id %>
+
+<%= labelled_form_for :glossary_category, @category,
+url: glossary_category_path do |f| %>
+ <%= render partial: 'glossary_categories/form', locals: {form: f} %>
+ <%= f.submit l(:button_edit) %>
+<% end %>
diff --git a/app/views/glossary_categories/index.html.erb b/app/views/glossary_categories/index.html.erb
new file mode 100644
index 0000000..c2fe0c8
--- /dev/null
+++ b/app/views/glossary_categories/index.html.erb
@@ -0,0 +1,22 @@
+<%=l :label_glossary_categories %>
+
+
+ <%= link_to l(:label_glossary_category_new), new_glossary_category_path, class: 'icon icon-add' %>
+
+
+
+
+
+ # |
+ <%=l :field_name %> |
+
+
+
+ <% @categories.each do |category| %>
+
+ <%= category.id %> |
+ <%= link_to category.name, category %> |
+
+ <% end %>
+
+
diff --git a/app/views/glossary_categories/new.html.erb b/app/views/glossary_categories/new.html.erb
new file mode 100644
index 0000000..6df492c
--- /dev/null
+++ b/app/views/glossary_categories/new.html.erb
@@ -0,0 +1,7 @@
+<%=l :label_glossary_category_new %>
+
+<%= labelled_form_for :glossary_category, @category,
+url: glossary_categories_path do |f| %>
+ <%= render partial: 'glossary_categories/form', locals: {form: f} %>
+ <%= f.submit l(:button_create) %>
+<% end %>
diff --git a/app/views/glossary_categories/show.html.erb b/app/views/glossary_categories/show.html.erb
new file mode 100644
index 0000000..f5470ec
--- /dev/null
+++ b/app/views/glossary_categories/show.html.erb
@@ -0,0 +1,11 @@
+
+ <%= link_to l(:button_edit), edit_glossary_category_path, class: 'icon icon-edit' %>
+ <%= link_to l(:button_delete), glossary_category_path, method: :delete,
+ data: {confirm: l(:text_are_you_sure)}, class: 'icon icon-del' %>
+
+
+<%=l :label_glossary_category %> #<%=@category.id %>
+
+<%= @category.name %>
+
+
diff --git a/config/locales/en.yml b/config/locales/en.yml
index c403bbd..adb138d 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -2,4 +2,7 @@
en:
label_glossary_terms: "Glossary terms"
label_glossary_term: "Glossary term"
- label_glossary_term_new: "New glossary term"
\ No newline at end of file
+ label_glossary_term_new: "New glossary term"
+ label_glossary_categories: "Glossary categories"
+ label_glossary_category: "Glossary category"
+ label_glossary_category_new: "New glossary category"
\ No newline at end of file
diff --git a/config/locales/ja.yml b/config/locales/ja.yml
index e3dcb96..7b1ab05 100644
--- a/config/locales/ja.yml
+++ b/config/locales/ja.yml
@@ -1,4 +1,7 @@
ja:
label_glossary_terms: "用語集"
label_glossary_term: "用語"
- label_glossary_term_new: "用語の作成"
\ No newline at end of file
+ label_glossary_term_new: "用語の作成"
+ label_glossary_categories: "用語のカテゴリ"
+ label_glossary_category: "用語のカテゴリ"
+ label_glossary_category_new: "カテゴリの作成"
diff --git a/test/functional/glossary_categories_controller_test.rb b/test/functional/glossary_categories_controller_test.rb
new file mode 100644
index 0000000..b5d8605
--- /dev/null
+++ b/test/functional/glossary_categories_controller_test.rb
@@ -0,0 +1,8 @@
+require File.expand_path('../../test_helper', __FILE__)
+
+class GlossaryCategoriesControllerTest < ActionController::TestCase
+ # Replace this with your real tests.
+ def test_truth
+ assert true
+ end
+end