Method to activate the University.
# File app/controllers/admin/universities_controller.rb, line 8 def activate respond_to do |format| if resource.update_attribute(:active, true) format.js {render 'referesh_datatable'} else format.js {redirect_to collection_path, alert: 'Unable to activate.'} end end end
Method to deactivate the University.
# File app/controllers/admin/universities_controller.rb, line 19 def deactivate respond_to do |format| if resource.update_attribute(:active, false) format.js {render 'referesh_datatable'} else format.js {redirect_to collection_path, alert: 'Unable to deactivate.'} end end end
Method to find the University and update it's background image
# File app/controllers/admin/universities_controller.rb, line 30 def upload_background_image @university = ActsAsTenant.current_tenant = University.find_by_subdomain(params[:id]) if @university.update_attributes(permitted_params[:university]) redirect_to admin_pages_path, notice: 'Image Updated successfully.' else redirect_to admin_pages_path, alert: 'Unable to update background image.' end end