diff --git a/controllers/mpog_software_plugin_myprofile_controller.rb b/controllers/mpog_software_plugin_myprofile_controller.rb index 70a50b1..2a05e4f 100644 --- a/controllers/mpog_software_plugin_myprofile_controller.rb +++ b/controllers/mpog_software_plugin_myprofile_controller.rb @@ -22,9 +22,7 @@ class MpogSoftwarePluginMyprofileController < MyProfileController @license_info = if params[:license_info].nil? LicenseInfo.new else - LicenseInfo.find(:first, - :conditions => ["version = ?", - "#{params[:license_info][:version]}"]) + LicenseInfo.find(params[:license_info][:version]) end control_software_creation diff --git a/public/mpog-software-validations.js b/public/mpog-software-validations.js index a6c2fbe..859576f 100644 --- a/public/mpog-software-validations.js +++ b/public/mpog-software-validations.js @@ -89,9 +89,8 @@ Element.insert(element_id, {bottom: content}); } - function get_license_link(select_id){ - var selected = jQuery('#'+select_id).selected().val(); - var link = jQuery("#version_" + selected).val(); + function get_license_link(){ + var link = jQuery("#version_" + this.value).val(); jQuery("#version_link") .attr("href", link) @@ -208,5 +207,7 @@ jQuery("#software_public_software").click(hide_show_public_software_fields); replace_software_creations_step(); + + jQuery("#license_info_version").change(get_license_link); }); })(); diff --git a/views/mpog_software_plugin_myprofile/_main_software_editor_extras.html.erb b/views/mpog_software_plugin_myprofile/_main_software_editor_extras.html.erb index d9eb0fb..87d7ba0 100644 --- a/views/mpog_software_plugin_myprofile/_main_software_editor_extras.html.erb +++ b/views/mpog_software_plugin_myprofile/_main_software_editor_extras.html.erb @@ -12,14 +12,13 @@