From: Tomas Sedovic tsedovic@redhat.com
Update to Rails 3 and newer HAML made our code obsolete and at some points even nonfunctional. --- src/app/views/hardware_profiles/_form.haml | 16 +++++++--------- src/app/views/hardware_profiles/new.haml | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/src/app/views/hardware_profiles/_form.haml b/src/app/views/hardware_profiles/_form.haml index 6ad9a6f..8326038 100644 --- a/src/app/views/hardware_profiles/_form.haml +++ b/src/app/views/hardware_profiles/_form.haml @@ -1,19 +1,17 @@ = error_messages_for @hardware_profile -=hwp_form.label :name -=hwp_form.text_field :name += hwp_form.label :name += hwp_form.text_field :name %table = sortable_table_header @header - [:memory, :cpu, :storage, :architecture].each do |type| - - hwp_form.fields_for type do |hwpp_form| + = hwp_form.fields_for type do |hwpp_form| %tr - %td - =hwpp_form.text_field(:name, :readonly => "readonly") - %td - =hwpp_form.text_field(:unit, :size => 5, :readonly => "readonly") + %td= hwpp_form.text_field(:name, :readonly => "readonly") + %td= hwpp_form.text_field(:unit, :size => 5, :readonly => "readonly") %td -if type == :architecture - =hwpp_form.select("value", ["i386", "x86_64"], {}) + = hwpp_form.select("value", ["i386", "x86_64"], {}) -else - =hwpp_form.text_field(:value) + = hwpp_form.text_field(:value) = hwp_form.submit 'Check Matches', :class => "submit button", :id => 'check_matches' = hwp_form.submit 'Save', :class => 'submit button', :id => 'save_button' diff --git a/src/app/views/hardware_profiles/new.haml b/src/app/views/hardware_profiles/new.haml index fc08757..16ec045 100644 --- a/src/app/views/hardware_profiles/new.haml +++ b/src/app/views/hardware_profiles/new.haml @@ -6,7 +6,7 @@ %h2 New Hardware Profile
.content - -form_for @hardware_profile, :url => hardware_profiles_path, :html => { :multipart => true } do |hwp_form| + = form_for @hardware_profile, :url => hardware_profiles_path, :html => { :multipart => true } do |hwp_form| = render :partial => "form", :locals => { :hwp_form => hwp_form }
= render :partial => 'matching_provider_hardware_profiles' if params[:commit] == 'Check Matches'
Ack and pushed.
On 08/08/2011 05:49 PM, tsedovic@redhat.com wrote:
From: Tomas Sedovictsedovic@redhat.com
Update to Rails 3 and newer HAML made our code obsolete and at some points even nonfunctional.
src/app/views/hardware_profiles/_form.haml | 16 +++++++--------- src/app/views/hardware_profiles/new.haml | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/src/app/views/hardware_profiles/_form.haml b/src/app/views/hardware_profiles/_form.haml index 6ad9a6f..8326038 100644 --- a/src/app/views/hardware_profiles/_form.haml +++ b/src/app/views/hardware_profiles/_form.haml @@ -1,19 +1,17 @@ = error_messages_for @hardware_profile -=hwp_form.label :name -=hwp_form.text_field :name += hwp_form.label :name += hwp_form.text_field :name %table = sortable_table_header @header - [:memory, :cpu, :storage, :architecture].each do |type|
- hwp_form.fields_for type do |hwpp_form|
- = hwp_form.fields_for type do |hwpp_form| %tr
%td
=hwpp_form.text_field(:name, :readonly => "readonly")
%td
=hwpp_form.text_field(:unit, :size => 5, :readonly => "readonly")
%td= hwpp_form.text_field(:name, :readonly => "readonly")
%td= hwpp_form.text_field(:unit, :size => 5, :readonly => "readonly") %td -if type == :architecture
=hwpp_form.select("value", ["i386", "x86_64"], {})
= hwpp_form.select("value", ["i386", "x86_64"], {}) -else
=hwpp_form.text_field(:value)
= hwp_form.submit 'Check Matches', :class => "submit button", :id => 'check_matches' = hwp_form.submit 'Save', :class => 'submit button', :id => 'save_button'= hwpp_form.text_field(:value)
diff --git a/src/app/views/hardware_profiles/new.haml b/src/app/views/hardware_profiles/new.haml index fc08757..16ec045 100644 --- a/src/app/views/hardware_profiles/new.haml +++ b/src/app/views/hardware_profiles/new.haml @@ -6,7 +6,7 @@ %h2 New Hardware Profile
.content
- -form_for @hardware_profile, :url => hardware_profiles_path, :html => { :multipart => true } do |hwp_form|
= form_for @hardware_profile, :url => hardware_profiles_path, :html => { :multipart => true } do |hwp_form| = render :partial => "form", :locals => { :hwp_form => hwp_form }
= render :partial => 'matching_provider_hardware_profiles' if params[:commit] == 'Check Matches'
aeolus-devel@lists.fedorahosted.org