20 lines
579 B
Ruby
20 lines
579 B
Ruby
|
class OrgSubfieldsController < ApplicationController
|
||
|
def create
|
||
|
@subfield = OrgSubfield.create(:name => params[:name])
|
||
|
@organization = Organization.find(params[:organization_id])
|
||
|
@organization.org_subfields << @subfield
|
||
|
@subfield.update_attributes(:priority => @subfield.id)
|
||
|
end
|
||
|
|
||
|
def destroy
|
||
|
@subfield = OrgSubfield.find(params[:id])
|
||
|
@organization = Organization.find(@subfield.organization_id)
|
||
|
@subfield.destroy
|
||
|
end
|
||
|
|
||
|
def update
|
||
|
@subfield = OrgSubfield.find(params[:id])
|
||
|
@subfield.update_attributes(:name => params[:name])
|
||
|
end
|
||
|
end
|