From 835af696703484208882a70cc5dd47c5838ecf58 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 12 Oct 2023 17:10:34 -0400 Subject: Added blog post commenting --- config/akismet.yml | 6 ++++++ config/deploy.rb | 2 +- config/initializers/akismet.rb | 2 ++ config/routes.rb | 6 +++++- 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 config/akismet.yml create mode 100644 config/initializers/akismet.rb (limited to 'config') diff --git a/config/akismet.yml b/config/akismet.yml new file mode 100644 index 0000000..581aa7b --- /dev/null +++ b/config/akismet.yml @@ -0,0 +1,6 @@ +production: + api_key: "" + app_url: "" +development: + api_key: "" + app_url: "" diff --git a/config/deploy.rb b/config/deploy.rb index b6cbdf9..cbac23c 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -21,7 +21,7 @@ set :deploy_to, "/srv/www/thoughts" # set :pty, true # Default value for :linked_files is [] -append :linked_files, "config/database.yml", "config/secrets.yml", "config/lingo.yml" +append :linked_files, "config/database.yml", "config/secrets.yml", "config/lingo.yml", "config/akismet.yml" # Default value for linked_dirs is [] append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "public/uploads" diff --git a/config/initializers/akismet.rb b/config/initializers/akismet.rb new file mode 100644 index 0000000..325e48f --- /dev/null +++ b/config/initializers/akismet.rb @@ -0,0 +1,2 @@ +Akismet.api_key = Rails.application.config_for(:akismet)[:api_key] +Akismet.app_url = Rails.application.config_for(:akismet)[:app_url] diff --git a/config/routes.rb b/config/routes.rb index 580cce4..2bae007 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -24,7 +24,11 @@ Rails.application.routes.draw do root "blogs#summary" - resources :blogs, only: [:index, :show], param: :slug, path: "blog" + resources :blogs, only: [:index, :show], param: :slug, path: "blog" do + member do + resources :comments, only: [:create] + end + end get 'thinks/:slug', to: 'streams#show', as: :stream -- cgit 1.4.1