diff --git a/app/controllers/my_profile/followed_people_controller.rb b/app/controllers/my_profile/followed_people_controller.rb deleted file mode 100644 index ee38813..0000000 --- a/app/controllers/my_profile/followed_people_controller.rb +++ /dev/null @@ -1,10 +0,0 @@ -class FollowedPeopleController < MyProfileController - - def index - @followed_people = Person.all.limit(10).paginate(:per_page => 5, :page => params[:npage]) - end - - def set_category - render :partial => "set_category_modal" - end -end diff --git a/app/controllers/my_profile/followers_controller.rb b/app/controllers/my_profile/followers_controller.rb new file mode 100644 index 0000000..ee38813 --- /dev/null +++ b/app/controllers/my_profile/followers_controller.rb @@ -0,0 +1,10 @@ +class FollowedPeopleController < MyProfileController + + def index + @followed_people = Person.all.limit(10).paginate(:per_page => 5, :page => params[:npage]) + end + + def set_category + render :partial => "set_category_modal" + end +end diff --git a/app/controllers/public/profile_controller.rb b/app/controllers/public/profile_controller.rb index 0540690..206f541 100644 --- a/app/controllers/public/profile_controller.rb +++ b/app/controllers/public/profile_controller.rb @@ -155,6 +155,18 @@ class ProfileController < PublicController end end + def follow + if !current_person.follows?(profile) + current_person.follow(profile) + end + end + + def unfollow + if current_person.follows?(profile) + current_person.unfollow(profile) + end + end + def check_friendship unless logged_in? render :text => '' -- libgit2 0.21.2