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