This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "openssl" | |
require 'base64' | |
KEY = "***************************************" | |
ALGORITHM = "AES-256-ECB" | |
def self.encrypt(message, iv) | |
cipher = OpenSSL::Cipher.new(ALGORITHM) | |
cipher.encrypt() | |
cipher.key = ENV["KEY"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.routes.draw do | |
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html | |
mount APIBase => "/api" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.routes.draw do | |
resources :photos do | |
collection do | |
get 'search' | |
end | |
end | |
# or | |
resources :photos do | |
get 'search', on: :collection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resources :photos do | |
get 'preview', on: :member | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.routes.draw do | |
resources :photos do | |
member do | |
get 'preview' | |
end | |
end | |
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.routes.draw do | |
namespace :api do | |
resources :articles, :comments | |
end | |
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.routes.draw do | |
resource :photos | |
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.routes.draw do | |
resource :photos | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"items": [ | |
{ | |
"countries": [ | |
{ | |
"id": 192, | |
"name": "Aceh", | |
"cities": [ | |
{ |
NewerOlder