Class: PufferPages::OriginsBase

Inherits:
Puffer::Base
  • Object
show all
Defined in:
lib/puffer_pages/backends/controllers/origins_base.rb

Direct Known Subclasses

Admin::OriginsController

Instance Method Summary collapse

Instance Method Details

#exportObject



18
19
20
21
22
23
24
# File 'lib/puffer_pages/backends/controllers/origins_base.rb', line 18

def export
  if params[:token] == PufferPages.access_token
    render json: resource.model.export_json
  else
    render nothing: true, status: 401
  end
end

#importObject



12
13
14
15
16
# File 'lib/puffer_pages/backends/controllers/origins_base.rb', line 12

def import
  @record = resource.member
  @record.import!
  redirect_to admin_origins_path
end