Skip to content

Commit 3cf9dce

Browse files
committed
why don't you put CATEGORIES = RefinerySetting.categories
1 parent d742717 commit 3cf9dce

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

vendor/plugins/tutorials/app/models/tutorial.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
class Tutorial < ActiveRecord::Base
22

3-
CATEGORIES = %w(Beginner Intermediate Advanced)
4-
53
acts_as_indexed :fields => [:title, :description, :category, :author, :content]
64
acts_as_taggable
75

vendor/plugins/tutorials/app/views/admin/tutorials/_form.html.erb

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
<div class='hemisquare' style='padding: 0px; margin: 10px 0px 10px 60px'>
1818
<div class='field' style='margin-bottom: 0px'>
1919
<%= f.label :level -%>
20-
<%= f.select :level, Tutorial::CATEGORIES, :class => 'widest'-%>
20+
<%= f.select :level, RefinerySetting.find_or_set(:tutorial_categories, %w(Beginner Intermediate Advanced)),
21+
:class => 'widest'-%>
2122
</div>
22-
23+
2324
<div class='field' style='margin-bottom: 0px'>
2425
<%= f.label :tag_list, 'Tags' -%>
2526
<%= f.text_field :tag_list, :class => 'widest'-%>

0 commit comments

Comments
 (0)