diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index ff6e518f..4d5c063d 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -30,7 +30,7 @@ class ServicesController < ApplicationController def update service = current_user.services.find(params[:id]) - service.post_tag = params[:service][:post_tag] + service.post_tag = params[:service][:post_tag].gsub('@', '') if service.save flash[:success] = "Service updated successfully" else diff --git a/app/views/settings/_services.haml b/app/views/settings/_services.haml index 0cc23b84..24087517 100644 --- a/app/views/settings/_services.haml +++ b/app/views/settings/_services.haml @@ -24,5 +24,5 @@ .col-md-6.mt-2 = bootstrap_form_for(service, as: 'service', url: update_service_path(service)) do |f| = f.text_field :post_tag, class: 'form-control', label: 'tag', label_as_placeholder: true, - append: f.submit('Update', class: 'btn btn-primary'), maxlength: 20, + append: f.submit('Update', class: 'btn btn-primary'), maxlength: 20, pattern: '^[^@]*$', help: "Automatically append a tag to your shared answers. #{'A # symbol is not automatically prepended.' if service.provider == 'twitter'}"