前提・実現したいこと
Meraki ダッシュボードでScannig APIからPOSTs URLを追加するとRails側で下記エラーメッセージがでます。
merakiからはjsonでPOSTされています
$bundle exec rails s
で起動はうまくいきます
URL:wex01.cloud24.jp/personal_logs
ルーティングに問題がありそうですが、アプローチの仕方がわかりません
どうかお力を貸して頂きたいです。
発生している問題・エラーメッセージ
ActionController::RoutingError (No route matches [GET] "/personal_log"):
該当のソースコード
ruby
1#app/controllers/personal_logs_controller.rb 2MERAKI_VALIDATOR = 'xxxxxxxxxxxxxxxxxxxxxx' 3MERAKI_SECRET = 'xxxxxxxxxxxx' 4 5 6class PersonalLogsController < ApplicationController 7 skip_before_action :verify_authenticity_token 8 before_action :set_personal_log, only: [:show, :edit, :update, :destroy] 9 10 def presenceapi 11 if request.post? 12 map = JSON.parse(params[:data]).with_indifferent_access 13 if map[:secret] == MERAKI_SECRET 14 map[:probing].each do |p| 15 Presence.create(ap_mac: p[:ap_mac], client_mac: p[:client_mac], 16 last_seen: DateTime.parse(p[:last_seen]), 17 rssi: p[:rssi]) 18 end 19 render :text => '' and return 20 else 21 Rails::logger.warn("*** MERAKI req with bad secret '#{map[:secret]}'") 22 rails 'access denied' 23 end 24 else 25 render :text => MERAKI_VALIDATOR 26 end 27 end 28end
ruby
1#config/routes.rb 2Rails.application.routes.draw do 3 get 'personal_logs', :to => 'personal_logs#presenceapi', :as => :personal_logs 4end
補足情報(FW/ツールのバージョンなど)
ディストリビューション
NAME="Amazon Linux AMI"
VERSION="2018.03"
ID=""
ID_LIKE=""
VERSION_ID=""
PRETTY_NAME="Amazon Linux AMI 2018.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2018.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"
Amazon Linux AMI release 2018.03
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/07/25 09:52
2018/07/25 10:11
2018/07/25 10:13
2018/07/25 14:09
2018/07/26 00:37