socialforge/app/controllers/subfield_subdomain_dirs_con...

11 lines
404 B
Ruby

class SubfieldSubdomainDirsController < ApplicationController
def update
@org_subfield = OrgSubfield.find(params[:org_subfield_id])
if @org_subfield.subfield_subdomain_dir
@org_subfield.subfield_subdomain_dir.update_attribute(:name, :params[:sub_dir_name])
else
SubfieldSubdomainDir.create(:org_subfield_id => @org_subfield.id, :name => params[:sub_dir_name])
end
end
end