Fix bug.
This commit is contained in:
parent
9d06684ed9
commit
5cd65d997f
|
@ -83,7 +83,11 @@ class Admin::RulingTemplatesController < OrbitAdminController
|
|||
FileUtils.remove_dir(directory)
|
||||
render :json => {"psd_id" => psd.id.to_s, "path" => psd.psd_zip.path}.to_json
|
||||
end
|
||||
|
||||
def destroy
|
||||
template = RTemplate.find(params[:id])
|
||||
template.destroy
|
||||
redirect_to :back
|
||||
end
|
||||
private
|
||||
|
||||
def template_params
|
||||
|
|
|
@ -2,7 +2,7 @@ class RulingTemplatesController < ApplicationController
|
|||
def index
|
||||
store_token = params[:store_token]
|
||||
site_domain = RegisteredSite.find_by(:uid => store_token).site_domain.sub(/(?:(?!\.).)*\./,'') rescue ''
|
||||
templates = RTemplate.where(allow_domain: site_domain,:git_url.ne=> '').asc(:updated_at).collect do |v|
|
||||
templates = RTemplate.where(:allow_domain.in => [site_domain,'',nil]).asc(:updated_at).collect do |v|
|
||||
{
|
||||
'install_flag' => v.installed_site_tokens.include?(store_token),
|
||||
'uid' => v.uid,
|
||||
|
|
Loading…
Reference in New Issue