From a66cb599a18d4854b45d5cd0b462639abafc4dfa Mon Sep 17 00:00:00 2001 From: Ari Timonen Date: Tue, 17 Mar 2020 04:19:59 +0200 Subject: [PATCH] JS fixes --- Gemfile.lock | 13 +++++-------- app/assets/javascripts/local.js | 10 +++++----- app/controllers/users_controller.rb | 4 ++++ config/application.rb | 3 +++ 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 4340ed6..2dedbff 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -95,8 +95,7 @@ GEM image_processing (~> 1.1) mimemagic (>= 0.3.0) mini_mime (>= 0.1.3) - childprocess (0.9.0) - ffi (~> 1.0, >= 1.0.11) + childprocess (3.0.0) cliver (0.3.2) coderay (1.1.2) coffee-rails (5.0.0) @@ -324,7 +323,7 @@ GEM ruby-progressbar (1.10.1) ruby-vips (2.0.17) ffi (~> 1.9) - rubyzip (1.3.0) + rubyzip (2.3.0) sanitize (5.1.0) crass (~> 1.0.2) nokogiri (>= 1.8.0) @@ -340,10 +339,9 @@ GEM sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) - selenium-webdriver (2.53.4) - childprocess (~> 0.5) - rubyzip (~> 1.0) - websocket (~> 1.0) + selenium-webdriver (3.142.7) + childprocess (>= 0.5, < 4.0) + rubyzip (>= 1.2.2) signet (0.11.0) addressable (~> 2.3) faraday (~> 0.9) @@ -389,7 +387,6 @@ GEM activemodel (>= 5.0) bindex (>= 0.4.0) railties (>= 5.0) - websocket (1.2.8) websocket-driver (0.7.1) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.4) diff --git a/app/assets/javascripts/local.js b/app/assets/javascripts/local.js index 6fbf463..98c816b 100644 --- a/app/assets/javascripts/local.js +++ b/app/assets/javascripts/local.js @@ -34,23 +34,23 @@ $(function() { // Forums fast reply - $("a#fastReply").live('click', function() { + $("a#fastReply").on('click', function() { $('#reply').fadeIn('slow') }); // Gather stuff - $("a#gather-info-hide").live('click', function() { + $("a#gather-info-hide").on('click', function() { $("div#gather-info").fadeOut('slow', 0); }); - $("a#gatherJoinBtn").live('click', function() { + $("a#gatherJoinBtn").on('click', function() { $('form#new_gatherer').submit(); }); // Submit TODO - $("a.submit").live('click', function() { + $("a.submit").on('click', function() { $(this).closest('form').submit() }); @@ -83,7 +83,7 @@ $(function() { }); // Users page - $("#users th a, #users .pagination a").live("click", function() { + $("#users th a, #users .pagination a").on("click", function() { $.getScript(this.href); return false; }); diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 23d697a..ec50e1d 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -127,6 +127,10 @@ class UsersController < ApplicationController private + def user_params + params.require(:user).permit(:password, :firstname, :lastname, :email, :steamid, :country, :birthdate, :timezone, :public_email, :filter) + end + def get_user @user = User.find(params[:id]) end diff --git a/config/application.rb b/config/application.rb index c3ee281..f7ee99b 100644 --- a/config/application.rb +++ b/config/application.rb @@ -4,6 +4,9 @@ require 'rails/all' Bundler.require(*Rails.groups(assets: %w(development test))) +# FIXME +ActionController::Parameters.permit_all_parameters = true + module Ensl class Application < Rails::Application # Custom error pages