Method to activate the Company.
# File app/controllers/admin/companies_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 Company.
# File app/controllers/admin/companies_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 Company and update it's background image
# File app/controllers/admin/companies_controller.rb, line 30 def upload_background_image @company = ActsAsTenant.current_tenant = Company.find_by_subdomain(params[:id]) if @company.update_attributes(permitted_params[:company]) redirect_to admin_pages_path, notice: 'Image Updated successfully.' else redirect_to admin_pages_path, alert: 'Unable to update background image.' end end