From 33bd5ae164da20a18aa0403d5fb22a910d751fe5 Mon Sep 17 00:00:00 2001 From: manson Date: Tue, 1 Jul 2014 19:24:19 +0800 Subject: [PATCH] forgot destroy method --- app/controllers/admin/writing_conferences_controller.rb | 5 +++++ app/views/admin/writing_conferences/destroy.js.erb | 1 + app/views/admin/writing_conferences/new.html.erb | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 app/views/admin/writing_conferences/destroy.js.erb diff --git a/app/controllers/admin/writing_conferences_controller.rb b/app/controllers/admin/writing_conferences_controller.rb index 0bad96e..035a1df 100644 --- a/app/controllers/admin/writing_conferences_controller.rb +++ b/app/controllers/admin/writing_conferences_controller.rb @@ -33,6 +33,11 @@ class Admin::WritingConferencesController < OrbitMemberController redirect_to '/admin/members/'+@member.to_param+'/WritingConference' end + def destroy + @writing_conference = WritingConference.find(params[:id]) + @writing_conference.destroy + end + def toggle_hide if params[:ids] @writing_conferences = WritingConference.any_in(_id: params[:ids]) diff --git a/app/views/admin/writing_conferences/destroy.js.erb b/app/views/admin/writing_conferences/destroy.js.erb new file mode 100644 index 0000000..35ab849 --- /dev/null +++ b/app/views/admin/writing_conferences/destroy.js.erb @@ -0,0 +1 @@ +$('#writing_conference_<%= @writing_conference.id.to_s%>').remove(); \ No newline at end of file diff --git a/app/views/admin/writing_conferences/new.html.erb b/app/views/admin/writing_conferences/new.html.erb index 896cf60..f21a037 100644 --- a/app/views/admin/writing_conferences/new.html.erb +++ b/app/views/admin/writing_conferences/new.html.erb @@ -1,4 +1,4 @@ -<%= form_for @writing_conference, url: admin_writing_conferences_path(@writing_conference), html: {class: "form-horizontal main-forms previewable"} do |f| %> +<%= form_for @writing_conference, url: admin_writing_conferences_path, html: {class: "form-horizontal main-forms previewable"} do |f| %>
<%= render partial: 'form', locals: {f: f} %>