2015-12-04 17:34:48 +08:00
|
|
|
class OrgSubfieldsController < ApplicationController
|
|
|
|
def create
|
|
|
|
@subfield = OrgSubfield.create(:name => params[:name])
|
|
|
|
@organization = Organization.find(params[:organization_id])
|
|
|
|
@organization.org_subfields << @subfield
|
2015-12-09 17:24:59 +08:00
|
|
|
@subfield.update_attributes(:priority => @subfield.id, :field_type => params[:field_type])
|
2015-12-04 17:34:48 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
def destroy
|
|
|
|
@subfield = OrgSubfield.find(params[:id])
|
|
|
|
@organization = Organization.find(@subfield.organization_id)
|
|
|
|
@subfield.destroy
|
|
|
|
end
|
|
|
|
|
|
|
|
def update
|
|
|
|
@subfield = OrgSubfield.find(params[:id])
|
2015-12-05 11:30:05 +08:00
|
|
|
@organization = Organization.find(@subfield.organization_id)
|
2015-12-04 17:34:48 +08:00
|
|
|
@subfield.update_attributes(:name => params[:name])
|
|
|
|
end
|
2015-12-11 16:30:50 +08:00
|
|
|
|
|
|
|
def show
|
|
|
|
|
|
|
|
end
|
2015-12-04 17:34:48 +08:00
|
|
|
end
|