Displaying 20 results from an estimated 300 matches similar to: "New features: Application properties and cookies"
2008 Jan 26
0
New feature: get profile pictures
The profile picture album is treated as a special album by Facebok and
is not returned in the normal get photo albums API call. A bunch of
special operations have to be performed to get the aid for the profile
picture album. I added a method to User to get the profile pics. Use
as follows:
facebook_session.user.profile_photos # returns Photo objects
Enjoy,
Shane
--
http://myfitbuddy.com |
2008 Dec 16
3
ApplicationProperties
Hi There,
I was wondering what the appropriate way to use the
applicationproperties.rb model was.
I was hoping to query it to find out which users are developers for my
app and then grant special permissions to them ...
I tried creating something like this:
class ApplicationProperties < ActiveRecord::Base
def facebook_session
@facebook_session ||=
returning
2007 Nov 18
0
Pseudo resource routes
I added a route mapper called facebook_resources. This allows you to
create pseudo-resource routes. Since everything is a POST in
Facebook, you can''t identify routes using HTTP verbs. Each route is
prefixed with its action, except for index.
Example:
map.facebook_resources :profiles
Will give you the following named routes:
new_profile POST /profiles/new
profiles POST
2007 Nov 21
0
Upgrade to latest trunk if you''re getting "undefined method `degree=''"
Facebook added the ''degree'' field to education info. This breaks
user.populate because the ''degree'' field doesn''t exist in the
education history model.
On a side note, if a method calls a dangerous method (ending with !),
shouldn''t it be classified as dangerous too?
Shane
--
http://myfitbuddy.com | http://shanesbrain.net |
2007 Nov 30
0
Rails test helpers
Hey guys-
I started a module for Rails test helpers. The first one is
assert_fb_redirect. This is like Rails'' assert_redirect, but works
for the fb:redirect FBML tag.
Any ideas for more? I was thinking about a version of assert_select
that works with Facebook. assert_select is based on CSS selectors,
which won''t work with Facebook since the use of colons (:) in search
2008 Jan 30
0
Publish templatized action with JSON gotcha in Rails 1.2
Hey guys-
to_json in Rails 1.2 produces json with unquoted keys, which is
invalid. Therefore, publish_templatized_action produces invalid json
for feed publishing, and you''ll get an error from Facebook. To fix
this, put this line in environment.rb:
ActiveSupport::JSON.unquote_hash_key_identifiers = false
You don''t need to do this if you''re running Rails 2.0. Just a
2008 May 08
0
New test helpers
Hey guys-
A few methods useful for testing have been added to trunk:
1) facebook_post
For use in controller unit tests and integration tests. Basically, it
delegates to the standard "post" method for simulating post requests
in a test, but constructs mock fb_sig params and passes them along to
the requested action with the rest of the params that the test
specifies.
2)
2007 Nov 30
5
render_to_string in an after filter
I''m using render_to_string in an after_filter, which renders a partial
that is sent to a web service. Here''s the code:
class MyController < ApplicationController
after_filter :post_to_webservice
def show
# show logic
end
def post_to_webservice
stuff = render_to_string :partial => ''stuff''
webservice_post(stuff)
end
I get a DoubleRenderError in the
2010 Feb 15
4
Changing the :path and :url options of has_attached_file in paperclip
Hello,
I am using the paperclip plugin to upload images and it works
absolutely fine.
I intend to save my uploaded images to C:\Application_name\public
folder. Accordingly, with some study over the i-net, I changed
the :path option of has_attached_file to -
:path => "C:/Application_name/
public/:class/:attachment/:id/:style_:basename.:extension"
Now, the files are being saved to
2008 Jan 23
2
Accessing the current session
I''m trying to fetch a session (and other fb user variables from the session) at the start of my controller, so that all the actions in that controller can make use of it. Here''s the code:
class FacebookController < ApplicationController
ensure_application_is_installed_by_facebook_user
fb_session = session[:facebook_session]
# ... action functions here ...
end
2008 Jun 12
0
Double Frame Problem
The only solution I''ve seen to the problem of the nested frame on the
login/install pages (when using iframes rather than fbml), is to use JS to cause
a redirect (c.f.
http://rubyforge.org/pipermail/facebooker-talk/2008-May/000638.html,
http://webjazz.blogspot.com/2008/03/gotchas-of-internal-iframe-facebook.html):
def create_new_facebook_session_and_redirect!
2006 Aug 03
5
Store common settings in one file?
Hi,
I''m looking for a way to store common settings, such as the
application_name or email address from value in a file.
I then want to be able to call these settings in my controllers and
models?
Is there any easy way of doing this? and where would you recommend I
save the file ?
Thanks
scott
--
Posted via http://www.ruby-forum.com/.
2008 May 06
1
check_friendship method only returning value of last pair
Hello, I''m new to facebooker and ruby, so not sure if the issue I am
having is due to my misunderstanding or a bug in facebooker plugin.
Here is what I have:
def show
@current_user ||= facebook_session.user
@member ||= params[:id].to_s==@current_user.id.to_s ?
@current_user : Facebooker::User.new(params[:id])
#for each of current_user''s friends, check if they are
2008 Apr 04
0
something wrong with event_members
I''ve got this code in one of my views:
<% for event in @facebook_session.events( :uid =>
@facebook_user.uid ) %>
<p><%= @facebook_session.event_members(event.eid).length %></p>
<% end %>
It should print the # of people coming to each of this user''s events.
Let''s say that would be "5 12 8". Instead
2009 Feb 15
2
Execute cap deploy:migrations fails
Hi there, I am trying to deploy a rails app on dreamhost.
Here is the error message that I get:
fatal: ''home/USER_NAME/DOMAIN_NAME/git/APPLICATION_NAME.git'': unable
to chdir or not a git archive
fatal: The remote end hung up unexpectedly
/Users/USER/.gem/ruby/1.8/gems/capistrano-2.5.3/lib/capistrano/recipes/
deploy/scm/git.rb:224:in `query_revision'': Unable to resolve
2008 Jun 12
6
Session Best Practices
Hi All- I am still trying to figure out the best way to handle facebook session for my users. Here is my current flow:
in my "external accounts controller"
1) before_filter :ensure_authenticated_to_facebook, :only => [:authenticate_facebook, :edit_facebook]
2) when the user links into facebook, facebooker authenticates and redirects back to my application
3) i detect the
2008 Jun 03
2
Order of authentication methods is causing unnecessary call to API?
Hey Guys,
I am wondering if I am missing something here. I am noticing that after a
user installs my app I get a request that not only contains an auth_key but
also contains a valid session key.
Occasionally I am seeing that Facebook server is occasionally sending a
connection reset during the auth key authentication method, this caused me
to notice that secure_with_token is given precedence in
2007 Dec 22
1
upgraded to rails 2.0.1 and borked sessions
I just pushed my facebook app up to 2.0.1 and noticed that I am now
getting these errors:
ActionView::TemplateError (Session key invalid or no longer valid) on
line #3 of users/index.fbml.erb:
It appears that I get the facebook_session object back but when i
introspect and try and get the user''s name or something i get the
session error. Has anyone else had these problems?
2006 Jul 28
0
GEM-based rails application installer
I just uploaded the first version of my .gem-based Rails application installer
to Rubyforge (http://rubyforge.org/projects/rails-installer/; gem install
rails-app-installer). This is extracted from Typo 4.0, and it''s intended to
make it easy to build user-friendly installers for Rails applications.
This isn''t intended to compete with Capistrano; it''s much
2008 Jan 24
12
getting started with facebooker
Hi,
I started with rfacebook but given the recent events figure its best
to move over to facebooker.
I have:
1.) Installed the facebooker plugin
2.) setup my facebook app (fbml/canvas)
3.) created a method on controller & view to handle initial request
4.) added "ensure_application_is_installed_by_facebook_user" to top
off application.rb
I am able to get to my landing page