Module: Admin::TopicHelper
- Defined in:
- app/helpers/admin/topic_helper.rb
Instance Method Summary collapse
- #access_list(current, options = {}) ⇒ Object
- #edit_topic_path(topic) ⇒ Object
- #topic_path(topic) ⇒ Object
Instance Method Details
#access_list(current, options = {}) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/helpers/admin/topic_helper.rb', line 11 def access_list(current, ={}) c = current.to_i if current c ||= 0 s = "" s = "<option value='0' #{'selected' if c==0}>Anyone</option>" unless [:include_anyone]==false s += "<option value='1' #{'selected' if c==1}>Any registered user</option>" s += [2,3,4,5,6,7,8,9].map { |l| "<option value='#{l}' #{'selected' if l==c}>Level #{l} User</option>" }.join("") return s.html_safe end |
#edit_topic_path(topic) ⇒ Object
7 8 9 |
# File 'app/helpers/admin/topic_helper.rb', line 7 def edit_topic_path(topic) "/admin/forums/topic/#{topic.id}/edit" end |
#topic_path(topic) ⇒ Object
3 4 5 |
# File 'app/helpers/admin/topic_helper.rb', line 3 def topic_path(topic) "/admin/forums/topic/#{topic.id}" end |