From fa48ff328309f877bc41ddb430126678c7d09362 Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Tue, 19 Feb 2008 18:32:09 +0000 Subject: [PATCH] ActionItem170: minor fix in submit button and one of the calls to it which was breaking several tests --- app/helpers/application_helper.rb | 4 ++-- app/views/cms/edit.rhtml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6041230..65a76fd 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -278,7 +278,7 @@ module ApplicationHelper end def submit_button(type, label, html_options = {}) - bt_cancel = html_options[:cancel] ? " " : '' + bt_cancel = html_options[:cancel] ? button(:cancel, _('Cancel'), html_options[:cancel]) : '' html_options[:class] = [html_options[:class], 'submit'].compact.join(' ') @@ -289,7 +289,7 @@ module ApplicationHelper bt_submit = submit_tag(label, html_options.merge(:class => the_class)) - bt_submit + bt_cancel + bt_submit end def button_to_function(type, label, js_code, html_options = {}) diff --git a/app/views/cms/edit.rhtml b/app/views/cms/edit.rhtml index d448b21..3e8cdd3 100644 --- a/app/views/cms/edit.rhtml +++ b/app/views/cms/edit.rhtml @@ -16,6 +16,6 @@ %> <% button_bar do %> - <%= submit_button('save', _('Save'), :cancel => [:action => (@article.parent ? 'view' : 'index')], :id => @article.parent) %> + <%= submit_button('save', _('Save'), :cancel => (@article.parent ? { :action => 'view', :id => @article.parent.id } : { :action => 'index' } )) %> <% end %> <% end %> -- libgit2 0.21.2