20 lines
470 B
Ruby
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
|