diff --git a/app/controllers/sub_domains_controller.rb b/app/controllers/sub_domains_controller.rb index d16444a74..c45dff1d7 100644 --- a/app/controllers/sub_domains_controller.rb +++ b/app/controllers/sub_domains_controller.rb @@ -5,6 +5,7 @@ class SubDomainsController < ApplicationController def new @subdomain = SubDomain.new @org_subfield = OrgSubfield.find(params[:org_subfield_id]) + @organization = @org_subfield.organization end def create diff --git a/app/helpers/sub_domains_helper.rb b/app/helpers/sub_domains_helper.rb index 8f189a38d..1a711b5e4 100644 --- a/app/helpers/sub_domains_helper.rb +++ b/app/helpers/sub_domains_helper.rb @@ -1,2 +1,3 @@ module SubDomainsHelper + include OrganizationsHelper end diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb index 6f45bd348..396741246 100644 --- a/app/views/organizations/setting.html.erb +++ b/app/views/organizations/setting.html.erb @@ -172,11 +172,10 @@ if ($("#subfield_name").val().trim() != "") $("#add_subfield_form").submit(); } - function add_org_subfield_subdomain(){ if ($("#subfield_name_subdomain").val().trim() != "") - alert("Test"); - $("#add_subfield_form_subdomain").submit(); + $("#add_subfield_form_subdomain").submit(); + $("#org_subfield_list").html('<%= escape_javascript(render(:partial => 'organizations/subfield_list', :locals => {:subfields => @organization.org_subfields.order("priority")} )) %>'); } var $is_exist = false; function apply_subdomain(id, domain){ diff --git a/app/views/sub_domains/_new.html.erb b/app/views/sub_domains/_new.html.erb index 510d469cf..ce0e802c4 100644 --- a/app/views/sub_domains/_new.html.erb +++ b/app/views/sub_domains/_new.html.erb @@ -23,8 +23,5 @@ \ No newline at end of file