Commit 447edc15 authored by Andi Saurer's avatar Andi Saurer

add DLR url

parent 48ad2927
require_dependency "short_message/application_controller"
module ShortMessage
class MessagesController < ApplicationController
def status
unless params[:id].blank? or params[:status].blank?
if message = ShortMessage::Message.find_by(message_key: params[:id])
message.status_code = params[:status]
message.save!
render plain: "Message #{params[:id]} has now status #{params[:status]}"
else
render plain: "Message #{params[:id]} not found!", status: 404
end
else
render plain: "Message ID or status not provided!", status: 400
end
end
end
end
ShortMessage::Engine.routes.draw do
Rails.application.routes.draw do
namespace :short_message do
get 'messages/status' => "messages#status"
post 'messages/status' => "messages#status"
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment