diff --git a/app/helpers/forms_helper.rb b/app/helpers/forms_helper.rb index aa1c879..a986af4 100644 --- a/app/helpers/forms_helper.rb +++ b/app/helpers/forms_helper.rb @@ -10,4 +10,16 @@ module FormsHelper end + def labelled_radio_button( human_name, name, value, checked = false, options = {} ) + options[:id] ||= 'radio-' + rand.to_s + radio_button_tag( name, value, checked, options ) + + content_tag( 'label', human_name, :for => options[:id] ) + end + + def labelled_check_box( human_name, name, value = "1", checked = false, options = {} ) + options[:id] ||= 'checkbox-' + rand.to_s + check_box_tag( name, value, checked, options ) + + content_tag( 'label', human_name, :for => options[:id] ) + end + end diff --git a/app/views/consumed_products/new.rhtml b/app/views/consumed_products/new.rhtml index d3131d2..b2eb615 100644 --- a/app/views/consumed_products/new.rhtml +++ b/app/views/consumed_products/new.rhtml @@ -3,8 +3,14 @@ <%= error_messages_for :consumption %> <% form_for :consumption, @consumption do |f| %> -

<%= _('Product:') %> <%= f.select "product_category_id", ProductCategory.find(:all).map{|pc| [pc.name, pc.id]} %>

-

<%= _('Aditional specifications:') %>
<%= f.text_area "aditional_specifications" %>

+

+ <%= _('Product:') %> + <%= f.select "product_category_id", ProductCategory.find(:all).map{|pc| [pc.name, pc.id]} %> +

+

+ <%= _('Aditional specifications:') %>
+ <%= f.text_area "aditional_specifications", :rows => 5 %> +

<% button_bar do %> <%= submit_button('add', _('Add product'), :cancel => {:action => 'index'}) %> <% end %> diff --git a/app/views/layouts/application.rhtml b/app/views/layouts/application.rhtml index edffd3c..8101af4 100644 --- a/app/views/layouts/application.rhtml +++ b/app/views/layouts/application.rhtml @@ -127,21 +127,23 @@ <% end %> -