[openstreetmap/openstreetmap-website] Separate forms for preferences and profile (#3257)

Andy Allan notifications at github.com
Wed Jul 21 18:13:27 UTC 2021


@gravitystorm commented on this pull request.



> +  layout "site"
+
+  before_action :authorize_web
+  before_action :set_locale
+
+  authorize_resource :class => false
+
+  before_action :check_database_readable
+  before_action :check_database_writable, :only => [:update]
+
+  def show; end
+
+  def edit; end
+
+  def update
+    current_user.languages = params[:user][:languages].split(",")

OK, I've refactored (and force-pushed) so that we use a partial to ensure the successful flash message is shown in the updated language (simply by deferring the lookup of the flash message to the subsequent page load). I've added tests, but the important one is disabled until there's actually another translation to test against!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/3257#discussion_r674219671
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20210721/9e5d0b99/attachment.htm>


More information about the rails-dev mailing list