7 lines
649 B
Plaintext
7 lines
649 B
Plaintext
<% @please_choice = (I18n.locale.to_s == "zh_tw") ? "請選擇" : "Please select." %>
|
|
<select name="<%=name%>" id="<%=id%>" class="<%=extra_class%> required" value="<%= value %>" style="width: auto;"><option value=""><%=@please_choice%></option>
|
|
<% @max_length = range[1].to_s.length %>
|
|
<% for @num in range[0] .. range[1] %>
|
|
<%= ('<option value="' + ((is_add_zero rescue false) ? @num.to_s.insert(0,(1..(@max_length-@num.to_s.length)).collect{"0"}.join) : @num.to_s) + '">' + ((is_add_zero rescue false) ? @num.to_s.insert(0,(1..(@max_length-@num.to_s.length)).collect{"0"}.join) : @num.to_s) + unit + '</option>').html_safe %>
|
|
<% end %>
|
|
</select> |