Sha256: 86c330628894c3d1c122604efb09fe48fb43b86400d8c16c65f4bb295f4f3093
Contents?: true
Size: 1.34 KB
Versions: 37
Compression:
Stored size: 1.34 KB
Contents
module ExtJS::Controller def self.included(controller) controller.send(:extend, ClassMethods) end ## # Controller class methods # module ClassMethods def extjs_reader(model) { "successProperty" => extjs_success_property, "root" => extjs_root, "messageProperty" => extjs_message_property }.merge(model.extjs_record) end def extjs_proxy(params) proxy = {} if params[:proxy] === 'direct' actions = ['create', 'read', 'update', 'destroy'] proxy["api"] = {} direct_actions.each_index do |n| proxy["api"][actions[n]] = direct_actions[n][:name] end else if params[:config]["api"] proxy["api"] = {} params[:config]["api"].each {|k,v| proxy["api"][k] = "/#{params[:controller]}/#{v}" } else proxy["url"] = "/#{params[:controller]}.#{params[:format].to_s}" end end proxy end def extjs_root(value=nil) ExtJS::MVC.root = value unless value.nil? ExtJS::MVC.root end def extjs_success_property(value=nil) ExtJS::MVC.success_property = value unless value.nil? ExtJS::MVC.success_property end def extjs_message_property(value=nil) ExtJS::MVC.message_property = value unless value.nil? ExtJS::MVC.message_property end end end
Version data entries
37 entries across 37 versions & 3 rubygems