Estoy intentando traer desde una base de datos en SQL un archivo tipo blob binario que es un pdf en realidad y poder visualizarlo desde una web que tengo en Ruby on Rails. Lo que he intentado realizar es lo siguiente:
<%= results = FirebirdDBModel.connection.execute("select RESUMEN from PERSONA_CC_RESUMEN where PERSONA_ID=24") %>
<% a = Affiliate.find_by_id(88) %>
<% results.each do |file| %>
<%= file[0] %>
<% end %>
Y el resultado que obtengo es lo siguiente: (lo adjunto en una imagen ya que es un conjunto de caracteres largo)
La tabla a la que consulto esta en la siguiente imagen, lo que quiero visualizar en mi web es el campo RESUMEN que es el pdf que necesito mostrar en la web.
Rails.application.routes.draw do
resources :affiliate_exceptions
resources :exception_types
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
root to: 'pages#inside'
#get 'inside', to: 'pages#inside', as: 'inside'
devise_for :users, controllers: { registrations: "registrations" }
get '/authorisations/my_authorisations', to: 'authorisations#my_authorisations'
get 'turns/turns_list', to: 'turns#turns_list'
get 'admin/turns/check_turns', to: 'admin/turns#check_turns'
get 'turns/todos', to: 'turns#todos'
get '/authorisations/statistics', to: 'authorisations#statistics'
get '/practices/out_of_average', to: 'practices#out_of_average'
namespace :api do
devise_for :users, skip: [:password, :confirmation, :unlock],
controllers: {
sessions: 'api/sessions',
registrations: 'api/registrations'
}
namespace :v1 do
get 'affiliate/active', to: 'affiliate#active'
post 'users/associate', to: 'users#associate'
resources :authorizations
end
match "*path", to: "errors#catch_404", via: :all
end
resources :affiliates, only: [:index, :show, :update]
resources :agreements, only: [:index]
resources :specialities
resources :specility_practice_diagnoses
resources :providers, only: [:index] do
collection do
get 'actives'
end
member do
get 'agreements'
end
member do
get 'specialities'
end
end
# get '/practices/:id/value', to: 'practices#value'
resources :practices, only: [:index] do
member do
get 'value'
end
end
resources :authorisations do
resources :items, controller: 'authorisation_practices'
member do
patch 'print'
end
end
namespace :admin do
root "base#index"
get 'import_fail_logs/index'
get 'import_fail_logs/remove_all'
resources :turns
resources :affiliate_types
resources :diagnosis
resources :people
resources :providers
resources :users
resources :affiliates do
resources :plans, controller: 'affiliate_plans', except: [:show, :new]
end
resources :relationships, only: [:create, :destroy, :index]
resources :agreements do
get 'praxis', to: 'agreement_practices#index'
end
resources :agreement_practices
resources :plans do
resources :affiliates, controller: 'plan_affiliates', only: [:create, :destroy, :index]
end
resources :practice_coinsurances
resources :provider_types
resources :practices
resources :affiliate_plans, only: [:edit, :update], as: "plans_affiliate"
resources :affiliate_exceptions
resources :exception_types
end
namespace :secretaries do
resources :managements, except: [:edit, :update]
end
namespace :affiliates do
resources :managements
end
resources :ctacte
resources :consumo_grp
resources :financiations, only: [:create, :index]
resources :schedules
resources :holidays
resources :turns
get 'turns/mostrar_turns', as: 'mostrar_turns'
resources :calendars do
resources :schedules
end
get 'turns/my_turns', as: 'my_turns'
get 'turns/show', as: 'show'
end