Created
February 7, 2013 20:35
-
-
Save bill-transue/4733939 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def collect_options_for_select(collection, selected=nil, &block) | |
options_for_select collection.collect { |member| block.call member }, selected | |
end | |
def elevations_for_sub_component_select(sub_component) | |
collect_options_for_select sub_component.component.send(sub_component.class.name.underscore.pluralize).find_all_by_model_id(sub_component.model_id), url_for do |sub_component| | |
if sub_component.is_a? SubComponentTemplate | |
[ sub_component.location, edit_admin_component_sub_component_path(sub_component.component, sub_component) ] | |
else | |
[ sub_component.location, edit_component_sub_component_path(sub_component.component, sub_component) ] | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment