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