Listing for Module-apps

This commit is contained in:
Matthew Fu committed 2012-01-12 14:13:41 +08:00
1 parent 3d9fd359ed
commit c0efb5d1bc
4 files changed
+83 -38

No files matched your search

@@ -4,14 +4,15 @@ class Admin::AppAuthsController < ApplicationController
before_filter :is_admin?
def index
@roles = Role.all.entries
apps = Purchase.where(:type =>"App")
@app_auth_data = apps.entries.map do |app|
app_c = eval(app.app_controller)
obj = app_c.new
obj_auth = obj.send "auth"
[:app_obj => app,:auth_field => obj_auth]
end
# @roles = Role.all.entries
# apps = Purchase.where(:type =>"App")
# @app_auth_data = apps.entries.map do |app|
# app_c = eval(app.app_controller)
# obj = app_c.new
# obj_auth = obj.send "auth"
# [:app_obj => app,:auth_field => obj_auth]
# end
@module_apps = ModuleApp.all
end
end
@@ -12,4 +12,22 @@ class Admin::ModuleAppsController < ApplicationController
format.js {}
end
end
def edit
@module_app = ModuleApp.find(params[:id])
end
def update
@module_app = ModuleApp.find(params[:id])
unless params['module_app']['enable_frontend'].nil?
@module_app.update_attribute('enable_frontend',params['module_app']['enable_frontend'])
@module_app.save!
end
@attribute = @module_app
respond_to do |format|
format.html { redirect_to :action => :index }
format.js { render 'admin/attributes/toggle_enable' }
end
end
end