From d07b8f4c090668cbdbf39e7e0bebabebf53a5c7f Mon Sep 17 00:00:00 2001 From: Bernie Chiu Date: Fri, 22 Nov 2013 17:18:04 +0800 Subject: [PATCH] Add Dynamic selection --- .../panel/feed/back_end/feeds_controller.rb | 3 +- .../panel/feed/back_end/feeds/edit.html.erb | 29 ++++++++++++++++++- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/vendor/built_in_modules/feed/app/controllers/panel/feed/back_end/feeds_controller.rb b/vendor/built_in_modules/feed/app/controllers/panel/feed/back_end/feeds_controller.rb index 9448960fd..9a90bbef5 100644 --- a/vendor/built_in_modules/feed/app/controllers/panel/feed/back_end/feeds_controller.rb +++ b/vendor/built_in_modules/feed/app/controllers/panel/feed/back_end/feeds_controller.rb @@ -12,12 +12,11 @@ class Panel::Feed::BackEnd::FeedsController < OrbitBackendController def new @feed = AnnouncementFeed.new - @categories = BulletinCategory.all end def edit @feed = AnnouncementFeed.find(params[:id]) - @categories = BulletinCategory.all + @categories = @feed.categories end def create diff --git a/vendor/built_in_modules/feed/app/views/panel/feed/back_end/feeds/edit.html.erb b/vendor/built_in_modules/feed/app/views/panel/feed/back_end/feeds/edit.html.erb index 6da95d308..35dc68b89 100644 --- a/vendor/built_in_modules/feed/app/views/panel/feed/back_end/feeds/edit.html.erb +++ b/vendor/built_in_modules/feed/app/views/panel/feed/back_end/feeds/edit.html.erb @@ -1,3 +1,30 @@ <%= form_for @feed, :url => panel_feed_back_end_feed_path, :method => :put, :html => {:class => "form-horizontal"} do |f| %> <%= render :partial => 'form', :locals => {:f => f} %> -<% end %> \ No newline at end of file +<% end %> + \ No newline at end of file