diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index e13820b5a..d6a7db8a7 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -29,4 +29,12 @@ class ServicesController < ApplicationController redirect_to edit_user_url current_user end + def fb_post + id = 'me' + type = 'feed' + + @res = MiniFB.post(@access_token, id, :type=>type, :metadata=>true, :params=>params) + redirect_to user_edit_url current_user + end + end diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 56a537c98..5f8e1e4f6 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -65,6 +65,12 @@ Connected to facebook as - @response_hash = MiniFB.get(@access_token, 'me') = @response_hash[:name] + + + - form_tag :controller => "services", :action => "fb_post" + = text_area_tag "message" + = submit_tag "send it off" + = link_to "Disconnect from Facebook", services_destroy_path - else = link_to "Connect to Facebook", @fb_access_url