From 07aa98e94f04f4ea34d65aba14f17fd38132a158 Mon Sep 17 00:00:00 2001 From: andrew Date: Sat, 17 Nov 2007 06:13:45 +0000 Subject: [PATCH] adding tags to page models git-svn-id: http://svn.barleysodas.com/barleysodas/trunk@33 0f7b21a7-9e3a-4941-bbeb-ce5c7c368fa7 --- app/models/page.rb | 1 + app/models/tag.rb | 2 ++ app/views/pages/_page.rhtml | 2 +- app/views/pages/_page_form.rhtml | 5 ++++- db/migrate/005_tags.rb | 18 ++++++++++++++++++ test/fixtures/tags.yml | 5 +++++ test/unit/tag_test.rb | 10 ++++++++++ 7 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 app/models/tag.rb create mode 100644 db/migrate/005_tags.rb create mode 100644 test/fixtures/tags.yml create mode 100644 test/unit/tag_test.rb diff --git a/app/models/page.rb b/app/models/page.rb index 3db489b..ff0cbab 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -12,6 +12,7 @@ # class Page < ActiveRecord::Base acts_as_versioned + acts_as_taggable belongs_to :owner, :polymorphic => true validates_presence_of :title diff --git a/app/models/tag.rb b/app/models/tag.rb new file mode 100644 index 0000000..972262c --- /dev/null +++ b/app/models/tag.rb @@ -0,0 +1,2 @@ +class Tag < ActiveRecord::Base +end diff --git a/app/views/pages/_page.rhtml b/app/views/pages/_page.rhtml index cb24886..65b8c54 100644 --- a/app/views/pages/_page.rhtml +++ b/app/views/pages/_page.rhtml @@ -11,7 +11,7 @@ <%= @page.html %>