moved the add people into a partial
This commit is contained in:
parent
62700387ad
commit
6bee872039
3 changed files with 9 additions and 5 deletions
|
|
@ -46,7 +46,7 @@ class AspectsController < ApplicationController
|
|||
|
||||
def show
|
||||
@aspect = current_user.aspect_by_id params[:id]
|
||||
@friends_dropdown_array = current_user.friends.all(:person_id.nin => @aspect.person_ids )
|
||||
@friends_not_in_aspect = current_user.friends.all(:person_id.nin => @aspect.person_ids )
|
||||
unless @aspect
|
||||
render :file => "#{Rails.root}/public/404.html", :layout => false, :status => 404
|
||||
else
|
||||
|
|
|
|||
|
|
@ -8,10 +8,9 @@
|
|||
=t('.add_a_new_friend_to')
|
||||
%i= aspect.name
|
||||
|
||||
= form_tag '/aspects/add_to_aspect', :id => 'add_to_aspect' do
|
||||
= select_tag :friend_id, options_from_collection_for_select(@friends_dropdown_array, "id", "real_name"), :include_blank => true
|
||||
= hidden_field_tag :aspect_id, aspect.id
|
||||
= submit_tag "add to #{@aspect.name}"
|
||||
- if @friends_not_in_aspect
|
||||
= render('shared/add_friend_dropdown', :aspect => @aspect, :friends => @friends_not_in_aspect)
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
5
app/views/shared/_add_friend_dropdown.html.haml
Normal file
5
app/views/shared/_add_friend_dropdown.html.haml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
= form_tag '/aspects/add_to_aspect', :id => 'add_to_aspect' do
|
||||
= select_tag :friend_id, options_from_collection_for_select(friends, "id", "real_name"), :include_blank => true
|
||||
= hidden_field_tag :aspect_id, aspect.id
|
||||
= submit_tag "add to #{aspect.name}"
|
||||
Loading…
Reference in a new issue