[Facebooker-talk] facebook_session not working for me

Dustin Anderson dustin at dustinanderson.com
Mon Apr 28 20:35:42 EDT 2008


Thanks Dave,

I deleted all the content in my session table - didn't seem to change
much, but we'll see.

Anyway, I noticed that when I hit the new action with a value in
params[:from], I get this error in my server log:

Filter chain halted as
[#<ActionController::Filters::ClassMethods::SymbolFilter:0x274f3e0
@filter=:ensure_application_is_installed_by_facebook_user>]
rendered_or_redirected.

Here is what my "invitations/new" action looks like:
  def new
    if params[:from]
      @user = facebook_session.user
      @user.profile_fbml = render_to_string(:partial=>"profile",
:locals=>{:from=>params[:from]})
    end
    @from_user_id = facebook_session.user.to_s
  end

For the record, I don't have +protect_from_forgery :secret+ set to
anything in application_controller.rb

any ideas what I'm doing wrong?

Thanks again for all the help...

Dustin


On Mon, Apr 28, 2008 at 11:21 AM, David Clements <digidigo at gmail.com> wrote:
> Hey Dustin,
>
> This is sounding a little familiar.  I am wondering if someone the
> facebook_session in your sessions table( you are using db sessions right? )
> doesn't have a user for some reason.   Can you blow away your session table
> and see if things get better?
>
> And also something isn't making sense here,  you say that facebook_session
> doesn't return anything?  But them you say @user is nil?  If
> facebook_session was nil then you would blow up before setting @user, right?
>
> Dave
>
>
>
> On Sun, Apr 27, 2008 at 7:06 PM, Dustin Anderson <dustin at dustinanderson.com>
> wrote:
> > Hey Dave, I'm definitely calling
> > ensure_application_is_installed_by_facebook_user in application.rb -
> > so if I hit the server directly (e.g. localhost:3000), it sends me to
> > a "You've already installed this app" page.
> >
> > Anyway, thanks Dave, but it must be something else... any other ideas?
> >
> > Thanks again for all the help.
> > Dustin
> >
> >
> >
> >
> > On Sun, Apr 27, 2008 at 3:12 PM, David Clements
> > <david.g.clements at gmail.com> wrote:
> > > I don't have the book in front if me, but are you calling one of the
> ensure
> > > methods?  Facebook_session will return nil unless you have authenticted
> to
> > > facebook.
> > >
> > >  Dave
> > >
> > >  Sent from my iPhone
> > >
> > >
> > >
> > >  On Apr 27, 2008, at 9:13 AM, "Dustin Anderson"
> <dustin at dustinanderson.com>
> > > wrote:
> > >
> > >
> > > > Thanks Ken,
> > > >
> > > > I could be wrong, but I'm pretty sure that facebook_session is being
> > > > defined on page 50 in the book so that it can be accessed in the
> > > > Model.  In my case, I'm just trying to call it from the controller...
> > > > so I should be able to call facebook_session in the controller ( I
> > > > think)?
> > > >
> > > > Any other ideas?
> > > >
> > > >
> > > >
> > > > On Sat, Apr 26, 2008 at 10:28 PM, Ken Schroeder
> <schroeder.ken at gmail.com>
> > > wrote:
> > > >
> > > > > Do you have the facebook_session method defined?
> > > > >
> > > > > From pg 50 from Mike's latest release.
> > > > >
> > > > > def facebook_session
> > > > >  @facebook_session ||=
> > > > >  returning Facebooker::Session.create do |session|
> > > > >   session.secure_with!(session_key,facebook_id,1.day.from_now)
> > > > >   end
> > > > > end
> > > > >
> > > > >
> > > > >
> > > > > On Sat, Apr 26, 2008 at 10:22 PM, Dustin Anderson
> > > > > <dustin at dustinanderson.com> wrote:
> > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > Hey All,
> > > > > >
> > > > > > I can't get facebook_session to return anything but nil.
> > > > > >
> > > > > > I'm following along in Mike Mangino's pragmatic programmer's book
> > > > > > about creating invitations - and adding info to a profile...
> > > > > >
> > > > > > There is a part where we are supposed to grab the @user to be able
> to
> > > > > > set the profile_fbml on it.
> > > > > > @user = facebook_session.user
> > > > > > @user.profile_fbml = render_to_string(:partial=>"profile",
> > > > > > :locals=>{:from=>params[:from]})
> > > > > >
> > > > > > Anyway, it never worked for me... I did an @user.inspect and it's
> just
> > > > > > nil.  facebook_session doesn't return anything.
> > > > > >
> > > > > > Any ideas?
> > > > > >
> > > > > > Thanks in advance!
> > > > > > Dustin
> > > > > > _______________________________________________
> > > > > > Facebooker-talk mailing list
> > > > > > Facebooker-talk at rubyforge.org
> > > > > > http://rubyforge.org/mailman/listinfo/facebooker-talk
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > _______________________________________________
> > > > > Facebooker-talk mailing list
> > > > > Facebooker-talk at rubyforge.org
> > > > > http://rubyforge.org/mailman/listinfo/facebooker-talk
> > > > >
> > > > >
> > > > >
> > > > _______________________________________________
> > > > Facebooker-talk mailing list
> > > > Facebooker-talk at rubyforge.org
> > > > http://rubyforge.org/mailman/listinfo/facebooker-talk
> > > >
> > >
> >
>
>
> _______________________________________________
>  Facebooker-talk mailing list
>  Facebooker-talk at rubyforge.org
>  http://rubyforge.org/mailman/listinfo/facebooker-talk
>
>


More information about the Facebooker-talk mailing list