Sha256: b02b81930e3028ad55421d0c8a118d3fc401c3855be64adf077fe0dbd9972631
Contents?: true
Size: 1.31 KB
Versions: 34
Compression:
Stored size: 1.31 KB
Contents
module ErpApp module Desktop module ControlPanel class DesktopManagementController < ErpApp::ApplicationController def desktop_preferences user = current_user desktop = ::Desktop.find_by_user(user) render :inline => "{\"success\":true, \"preference_types\":#{desktop.preference_types.to_json(:include => :preference_options)}}" end def selected_desktop_preferences user = current_user desktop = ::Desktop.find_by_user(user) render :inline => "{\"success\":true, \"preferences\":#{desktop.preferences.to_json(:include => [:preference_type, :preference_option])}}" end def update_desktop_preferences user = current_user desktop = ::Desktop.find_by_user(user) params.each do |k,v| desktop.set_preference(k, v) unless (k.to_s == 'action' or k.to_s == 'controller' or k.to_s == 'authenticity_token') end desktop.save render :inline => "{\"success\":true, \"preferences\":#{desktop.preferences.to_json(:include => [:preference_type, :preference_option])}}" end def add_background render :inline => ::Desktop.add_background(params[:description], params[:image_data]).to_json end end end end end
Version data entries
34 entries across 34 versions & 1 rubygems