Class: Passkit::Dashboard::PreviewsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/passkit/dashboard/previews_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



4
5
# File 'app/controllers/passkit/dashboard/previews_controller.rb', line 4

def index
end

#showObject



7
8
9
10
11
12
# File 'app/controllers/passkit/dashboard/previews_controller.rb', line 7

def show
  builder = Passkit.configuration.available_passes[params[:class_name]]
  path = Factory.create_pass(params[:class_name].constantize, builder.call)

  send_file path, type: "application/vnd.apple.pkpass", disposition: "attachment", filename: "pass.pkpass"
end