engine/app/controllers/locomotive/import_controller.rb

34 lines
723 B
Ruby
Raw Normal View History

module Locomotive
class ImportController < BaseController
sections 'settings', 'site'
skip_load_and_authorize_resource
before_filter :authorize_import
2011-12-11 22:33:38 +00:00
respond_to :json, :only => :show
def show
@import = Locomotive::Import::Model.current(current_site)
respond_with @import
end
def new
@import = Locomotive::Import::Model.new
respond_with @import
end
def create
@import = Locomotive::Import::Model.create(params[:import].merge(:site => current_site))
respond_with @import, :location => Locomotive.config.delayed_job ? import_url : new_import_url
end
protected
def authorize_import
authorize! :import, Site
end
end
2011-12-11 22:33:38 +00:00
end