From: Imre Farkas ifarkas@redhat.com
--- src/Gemfile.lock | 2 ++ src/app/controllers/deployables_controller.rb | 2 +- src/app/views/deployables/_from_url.html.haml | 1 + src/app/views/deployables/_upload.html.haml | 1 + 4 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/src/Gemfile.lock b/src/Gemfile.lock index 1c19f6a..b6c8dfb 100644 --- a/src/Gemfile.lock +++ b/src/Gemfile.lock @@ -135,6 +135,7 @@ GEM ffi (>= 1.0.7) json_pure rubyzip + silent-postgres (0.1.1) simple-navigation (3.0.0) activesupport (>= 2.3.2) sqlite3 (1.3.3) @@ -188,6 +189,7 @@ DEPENDENCIES rspec-rails ruby-net-ldap sass + silent-postgres simple-navigation sqlite3 thin diff --git a/src/app/controllers/deployables_controller.rb b/src/app/controllers/deployables_controller.rb index 13d4f3e..4033b96 100644 --- a/src/app/controllers/deployables_controller.rb +++ b/src/app/controllers/deployables_controller.rb @@ -151,7 +151,7 @@ class DeployablesController < ApplicationController else @catalog = @selected_catalogs.first params.delete(:edit_xml) if params[:edit_xml] - @form_option = params[:deployable].has_key?(:xml) ? 'upload' : 'from_url' + @form_option = params[:form_option].eql?('upload') ? 'upload' : 'from_url' end render :new end diff --git a/src/app/views/deployables/_from_url.html.haml b/src/app/views/deployables/_from_url.html.haml index de7d253..89fc825 100644 --- a/src/app/views/deployables/_from_url.html.haml +++ b/src/app/views/deployables/_from_url.html.haml @@ -2,6 +2,7 @@ - if @deployable.errors.any? = render 'layouts/error_messages', :object => @deployable %fieldset + = hidden_field_tag('form_option', @form_option) %p = form.label :catalog_id, t('deployables.form.catalog') %span.text_instead_input diff --git a/src/app/views/deployables/_upload.html.haml b/src/app/views/deployables/_upload.html.haml index 103ccf6..7f87a60 100644 --- a/src/app/views/deployables/_upload.html.haml +++ b/src/app/views/deployables/_upload.html.haml @@ -2,6 +2,7 @@ - if @deployable.errors.any? = render 'layouts/error_messages', :object => @deployable %fieldset + = hidden_field_tag('form_option', @form_option) %p = label_tag :catalog_id, t('deployables.form.catalog') %span.text_instead_input