Sha256: 51dee9dbe04d6faf9a18087ad1c9a304c297d0e96f4b54113e540a871ddc0f23

Contents?: true

Size: 821 Bytes

Versions: 17

Compression:

Stored size: 821 Bytes

Contents

module ErpApp
	class WidgetProxyController < ErpApp::ApplicationController
	  
    attr_accessor :performed_redirect

    def index
      @widget_name = params[:widget_name]
      @widget_action = params[:widget_action]
      @uuid = params[:uuid]

      #get widget params
      widget_params = nil
      widget_params = JSON.parse(params[:widget_params]) unless params[:widget_params].blank?

      widget_obj = "::Widgets::#{@widget_name.camelize}::Base".constantize.new(self, @widget_name, @widget_action, @uuid, widget_params, @website)

      result = widget_obj.process(@widget_action)

      #if there was no result just return
      return if result.nil?

      if result.is_a?(Hash)
        render result
      else
        render :inline => result
      end
    end
    
	end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
erp_app-3.1.16 app/controllers/erp_app/widget_proxy_controller.rb
erp_app-3.1.15 app/controllers/erp_app/widget_proxy_controller.rb
erp_app-3.1.14 app/controllers/erp_app/widget_proxy_controller.rb
erp_app-3.1.13 app/controllers/erp_app/widget_proxy_controller.rb
erp_app-3.1.12 app/controllers/erp_app/widget_proxy_controller.rb
erp_app-3.1.11 app/controllers/erp_app/widget_proxy_controller.rb
erp_app-3.1.10 app/controllers/erp_app/widget_proxy_controller.rb
erp_app-3.1.9 app/controllers/erp_app/widget_proxy_controller.rb
erp_app-3.1.8 app/controllers/erp_app/widget_proxy_controller.rb
erp_app-3.1.7 app/controllers/erp_app/widget_proxy_controller.rb
erp_app-3.1.6 app/controllers/erp_app/widget_proxy_controller.rb
erp_app-3.1.5 app/controllers/erp_app/widget_proxy_controller.rb
erp_app-3.1.4 app/controllers/erp_app/widget_proxy_controller.rb
erp_app-3.1.3 app/controllers/erp_app/widget_proxy_controller.rb
erp_app-3.1.2 app/controllers/erp_app/widget_proxy_controller.rb
erp_app-3.1.1 app/controllers/erp_app/widget_proxy_controller.rb
erp_app-3.1.0 app/controllers/erp_app/widget_proxy_controller.rb