From cc70638a652146bc309836f8a6345511c5a980c3 Mon Sep 17 00:00:00 2001 From: MoisesMachado Date: Tue, 15 Jan 2008 18:03:27 +0000 Subject: [PATCH] ActionItem121: added a cancel buton to the display_submit_tag --- app/helpers/application_helper.rb | 7 +++++-- app/views/profile_editor/organization_info.rhtml | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 8945828..c7f7286 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -176,8 +176,11 @@ module ApplicationHelper end alias_method :display_form_field, :labelled_form_field - def display_submit_tag(label) - content_tag('p', submit_tag( label, :class => 'submit'), :class => 'submitline') + # FIXME: do not use window.history on the cancel button, instead go to the page where the user come from + def display_submit_tag(label, options = {}) + cancel_button = '' + cancel_button = " " if options[:with_cancel] + content_tag('p', submit_tag( label, :class => 'submit') + cancel_button, :class => 'submitline') end diff --git a/app/views/profile_editor/organization_info.rhtml b/app/views/profile_editor/organization_info.rhtml index 71b9702..a5d0efc 100644 --- a/app/views/profile_editor/organization_info.rhtml +++ b/app/views/profile_editor/organization_info.rhtml @@ -5,5 +5,5 @@ <%= f.text_field(:legal_form) %> <%= f.text_field(:economic_activity) %> <%= f.text_area(:management_information) %> - <%= display_submit_tag(_('Save')) %> + <%= display_submit_tag(_('Save'), :with_cancel => true) %> <% end %> -- libgit2 0.21.2