From b7bc1d5d2b4e47443a84c5327d7a748df694a951 Mon Sep 17 00:00:00 2001 From: Lucia Date: Tue, 29 Aug 2017 17:22:50 +0800 Subject: [PATCH 1/7] add authenticity_token to form --- app/controllers/application_controller.rb | 2 +- app/helpers/users_helper.rb | 8 +++++--- app/views/events/show.html.erb | 6 +++--- config/routes.rb | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 682a07d..cd6ea53 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,6 +1,6 @@ class ApplicationController < ActionController::Base - # protect_from_forgery with: :exception + protect_from_forgery with: :exception helper_method :current_cart diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index ed49051..b9ecfaf 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -7,9 +7,11 @@ def user_avatar_link(user) email_md5 = Digest::MD5.hexdigest(user.email) gravatar_url = "https://www.gravatar.com/avatar/#{email_md5}" - str = "" - - str.html_safe + # str = "" + # + # str.html_safe + "".html_safe + end end diff --git a/app/views/events/show.html.erb b/app/views/events/show.html.erb index 0e89067..2996fec 100644 --- a/app/views/events/show.html.erb +++ b/app/views/events/show.html.erb @@ -22,14 +22,14 @@
- <%= raw comment.content %> + <%= sanitize comment.content %>