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

exceptionHandle
wanglinchun 11 years ago
parent 907960fe75
commit 2f709c92ba

@ -708,6 +708,14 @@ module ApplicationHelper
end end
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 # Redmine links
# #
# Examples: # Examples:

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

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

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

Loading…
Cancel
Save