2007-12-03 03:47:21 -05:00
|
|
|
module PeoplesHelper
|
|
|
|
def new_people_link
|
|
|
|
link_to 'Sign Up!', new_people_path, { :title => 'Sign Up!' }
|
|
|
|
end
|
|
|
|
|
|
|
|
def show_people_link(people)
|
2008-04-13 04:16:26 -04:00
|
|
|
link_to people.title, people_path(people), { :title => people.title }
|
2007-12-03 03:47:21 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def edit_people_link(people)
|
2008-04-13 04:16:26 -04:00
|
|
|
link_to 'Edit People', edit_people_path(people),
|
2007-12-03 03:47:21 -05:00
|
|
|
{ :title => "Edit #{people.title}" }
|
|
|
|
end
|
2008-02-01 02:43:40 -05:00
|
|
|
|
|
|
|
def show_friends_link(people)
|
|
|
|
link_to "#{people.title}'s Friends (#{people.actual_friends.size})",
|
2008-04-13 04:16:26 -04:00
|
|
|
friend_path(people)
|
2008-02-01 02:43:40 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def add_friend_link(people)
|
|
|
|
link_to "#{image_tag('list-add.png')} Friend",
|
|
|
|
friends_path('friend[source_id]' => session[:people_id],
|
|
|
|
'friend[destination_id]' => people.id), :method => :post
|
|
|
|
end
|
|
|
|
|
|
|
|
def remove_friend_link(people)
|
|
|
|
link_to "#{image_tag('list-remove.png')} Friend",
|
2008-04-13 04:16:26 -04:00
|
|
|
friend_url(people, :d => session[:people_id]), :method => :delete
|
2008-02-01 02:43:40 -05:00
|
|
|
end
|
2007-12-03 03:47:21 -05:00
|
|
|
end
|