From a994208ac25a6820dc93aaaee1143992ce0d62f3 Mon Sep 17 00:00:00 2001 From: futurechimp Date: Sat, 4 Jun 2011 21:22:07 +0100 Subject: [PATCH] Improving the Feed creation form. --- admin/controllers/feeds.rb | 1 + admin/views/feeds/_form.erb | 24 +++++++++++++------ admin/views/feeds/new.erb | 5 +++- .../admin/feeds_controller_test.rb | 5 ++++ 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/admin/controllers/feeds.rb b/admin/controllers/feeds.rb index e54e354..7562468 100644 --- a/admin/controllers/feeds.rb +++ b/admin/controllers/feeds.rb @@ -6,6 +6,7 @@ end get :new do + @wires = Wire.all @feed = Feed.new render 'feeds/new' end diff --git a/admin/views/feeds/_form.erb b/admin/views/feeds/_form.erb index 1db30b5..afcfca2 100644 --- a/admin/views/feeds/_form.erb +++ b/admin/views/feeds/_form.erb @@ -1,5 +1,6 @@
- <%= f.label :default_moderation_status %><%= f.error_message_on :default_moderation_status %> + <%= f.label :default_moderation_status %> + <%= f.error_message_on :default_moderation_status %> <%= f.text_field :default_moderation_status, :class => :text_field %> Ex: a simple text
@@ -8,15 +9,24 @@ <%= f.text_field :url, :class => :text_field %> Ex: a simple text +
- <%= f.label :_id %><%= f.error_message_on :_id %> - <%= f.text_field :_id, :class => :text_field %> - Ex: a simple text + <%= f.label :wire %><%= f.error_message_on :wire %> + <%= f.select :wire_id, :collection => @wires, :fields => [:name, :id] %> + Please choose a wire.
+ +<% if @feed and @feed.image_url %> +
+ Current default image:
+ <%= image_tag @feed.image_url("small") if @feed.image_url %> +
+<% end %> +
- <%= f.label :_type %><%= f.error_message_on :_type %> - <%= f.text_field :_type, :class => :text_field %> - Ex: a simple text + <%= label_tag :image %><%= f.error_message_on :image %> + <%= file_field_tag :image %> + Please upload a default image