Files
old-roraccounting/app/controllers/static_controller.rb
2020-09-04 09:26:12 +03:00

20 lines
470 B
Ruby

class StaticController < ActionController::API
include ActionView::Layouts
include BasicAuth
def frontend_index_html
if params[:path].present?
send_file params[:path]
else
render file: 'protected_public/index.html'
end
end
def frontend_static
full_path = "protected_public/#{params[:path]}.#{params[:format]}"
send_file full_path
rescue ActionController::MissingFile
render file: 'protected_public/index.html'
end
end