From 3ebda174fb519f93cffd89268ea7f2c0d3af01da Mon Sep 17 00:00:00 2001 From: zhitomirskiyi Date: Thu, 27 Jan 2011 13:40:58 -0800 Subject: [PATCH] make aspect list visible option on new_aspect pane --- app/controllers/aspects_controller.rb | 4 ++++ app/views/aspects/_new_aspect.haml | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 24f8fcc52..46321e441 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -37,6 +37,10 @@ class AspectsController < ApplicationController end def create @aspect = current_user.aspects.create(params[:aspect]) + #hack, we don't know why mass assignment is not working + @aspect.contacts_visible = params[:aspect][:contacts_visible] + @aspect.save + if @aspect.valid? flash[:notice] = I18n.t('aspects.create.success', :name => @aspect.name) if current_user.getting_started diff --git a/app/views/aspects/_new_aspect.haml b/app/views/aspects/_new_aspect.haml index d531b4890..ff5c2978b 100644 --- a/app/views/aspects/_new_aspect.haml +++ b/app/views/aspects/_new_aspect.haml @@ -12,9 +12,12 @@ %p = aspect.label :name , t('.name') = aspect.text_field :name, :maxlength => 20 - = t('aspects.contacts_visible') - = aspect.check_box :contacts_visible, :default => true + + %p.checkbox_select + = aspect.label :contacts_visible, t('aspects.edit.make_aspect_list_visible') + = aspect.check_box :contacts_visible, :default => true + %br - = t('aspects.contacts_not_visible') + = aspect.submit t('.create'), :class => 'button'