重构bid_helper,contest_helper以及application_helper中共同用到的方法

This commit is contained in:
wanglinchun 2014-05-22 12:38:30 +08:00
parent 907960fe75
commit 2f709c92ba
4 changed files with 31 additions and 23 deletions

View File

@ -708,6 +708,14 @@ module ApplicationHelper
end
end
def select_option_helper option
tmp = Hash.new
tmp={"" => ""}
option.each do |project|
tmp[project.name] = project.identifier
end
tmp
end
# Redmine links
#
# Examples:

View File

@ -143,12 +143,12 @@ module BidsHelper
people.include?(User.current)
end
def select_option_helper option
tmp = Hash.new
option.each do |project|
tmp[project.name] = project.identifier
end
tmp
end
# def select_option_helper option
# tmp = Hash.new
# option.each do |project|
# tmp[project.name] = project.identifier
# end
# tmp
# end
end

View File

@ -157,14 +157,14 @@ module ContestsHelper
people.include?(User.current)
end
def select_option_helper option
tmp = Hash.new
tmp={"" => ""}
option.each do |project|
tmp[project.name] = project.identifier
end
tmp
end
# def select_option_helper option
# tmp = Hash.new
# tmp={"" => ""}
# option.each do |project|
# tmp[project.name] = project.identifier
# end
# tmp
# end
def select_option_app_helper options
tmp = Hash.new
options.each do |option|

View File

@ -14,13 +14,13 @@ module SoftapplicationsHelper
content_tag('div', content, :class => "tabs")
end
def select_option_helper option
tmp = Hash.new
option.each do |project|
tmp[project.name] = project.identifier
end
tmp
end
# def select_option_helper option
# tmp = Hash.new
# option.each do |project|
# tmp[project.name] = project.identifier
# end
# tmp
# end
end