I may be missing something, but I am unable to do a RESTful delete using Facebooker. In routes.rb, I have: map.resources :runs I am using the following to try and delete: <%= link_to "Delete", run, :method => :delete %> However, instead of calling ''delete'' it does the ''show'' action. How can I do a RESTful delete using Facebooker? Thanks, Brian
I sent this question out about a week ago, but never got a response... I have so far been unable to do a RESTful delete using Facebooker. In my config/routes.rb, I have: map.resources :runs I am trying to do the delete using: <%= link_to "Delete", run, :method => :delete %> However, instead of doing the ''delete'', it calls the ''show'' action. Has anyone been successful doing a RESTful delete using Facebooker? Thanks, Brian
I know the FB Data Store API supports RESTful deletes but does the regular API support it? On Thu, Feb 14, 2008 at 12:09 PM, Brian Howenstein <brian at hwrd.com> wrote:> I sent this question out about a week ago, but never got a response... > > I have so far been unable to do a RESTful delete using Facebooker. > > In my config/routes.rb, I have: > > map.resources :runs > > I am trying to do the delete using: > > <%= link_to "Delete", run, :method => :delete %> > > However, instead of doing the ''delete'', it calls the ''show'' action. > > Has anyone been successful doing a RESTful delete using Facebooker? > > Thanks, > Brian > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk >
Brian- Is this a link to a canvas page or an action on your callback server? Can you try link_to with either :canvas => true or :canvas => false and see if it works? Shane On Thu, Feb 14, 2008 at 2:09 PM, Brian Howenstein <brian at hwrd.com> wrote:> I sent this question out about a week ago, but never got a response... > > I have so far been unable to do a RESTful delete using Facebooker. > > In my config/routes.rb, I have: > > map.resources :runs > > I am trying to do the delete using: > > <%= link_to "Delete", run, :method => :delete %> > > However, instead of doing the ''delete'', it calls the ''show'' action. > > Has anyone been successful doing a RESTful delete using Facebooker? > > Thanks, > Brian > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk >-- http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com
Hi Shane, I tried both ways with identical results to my original message. I am trying to call a normal REST ''destroy'' action in my controller from a canvas page: # DELETE /runs/1 # DELETE /runs/1.xml def destroy @run = Run.find(params[:id]) @run.destroy respond_to do |format| format.html { redirect_to(runs_url) } format.fbml { redirect_to(runs_url) } format.xml { head :ok } end It appears that it is trying to do a POST to /runs/1 when it should be doing a DELETE to /runs/1. Since it is doing a POST, it looks to be calling the ''show'' action instead of the ''destroy'' action. Any ideas? Thanks, Brian On Feb 14, 2008, at 3:45 PM, Shane Vitarana wrote:> Brian- > > Is this a link to a canvas page or an action on your callback server? > Can you try link_to with either :canvas => true or :canvas => false > and see if it works? > > Shane > > On Thu, Feb 14, 2008 at 2:09 PM, Brian Howenstein <brian at hwrd.com> > wrote: >> I sent this question out about a week ago, but never got a >> response... >> >> I have so far been unable to do a RESTful delete using Facebooker. >> >> In my config/routes.rb, I have: >> >> map.resources :runs >> >> I am trying to do the delete using: >> >> <%= link_to "Delete", run, :method => :delete %> >> >> However, instead of doing the ''delete'', it calls the ''show'' action. >> >> Has anyone been successful doing a RESTful delete using Facebooker? >> >> Thanks, >> Brian >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk >> > > > > -- > http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com
What source gets generated by that? Is it using Prototype to build a form on demand? If so, that won''t work since prototype doesn''t work via FBJS. I''m slowly but surely working on replacing prototype functionality inside facebook with working FBJS. I''d love some help with that. Mike On Feb 14, 2008, at 2:09 PM, Brian Howenstein wrote:> I sent this question out about a week ago, but never got a response... > > I have so far been unable to do a RESTful delete using Facebooker. > > In my config/routes.rb, I have: > > map.resources :runs > > I am trying to do the delete using: > > <%= link_to "Delete", run, :method => :delete %> > > However, instead of doing the ''delete'', it calls the ''show'' action. > > Has anyone been successful doing a RESTful delete using Facebooker? > > Thanks, > Brian > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk-- Mike Mangino http://www.elevatedrails.com
Mike- It''ll be great to have an FBJS version of Prototype (and possibly JQuery). David Newbury already has a FBJS version of getElementsByClassName that we can contribute. Shane On Thu, Feb 14, 2008 at 4:04 PM, Mike Mangino <mmangino at elevatedrails.com> wrote:> What source gets generated by that? Is it using Prototype to build a > form on demand? If so, that won''t work since prototype doesn''t work > via FBJS. > > I''m slowly but surely working on replacing prototype functionality > inside facebook with working FBJS. I''d love some help with that. > > Mike > > > > On Feb 14, 2008, at 2:09 PM, Brian Howenstein wrote: > > > I sent this question out about a week ago, but never got a response... > > > > I have so far been unable to do a RESTful delete using Facebooker. > > > > In my config/routes.rb, I have: > > > > map.resources :runs > > > > I am trying to do the delete using: > > > > <%= link_to "Delete", run, :method => :delete %> > > > > However, instead of doing the ''delete'', it calls the ''show'' action. > > > > Has anyone been successful doing a RESTful delete using Facebooker? > > > > Thanks, > > Brian > > _______________________________________________ > > Facebooker-talk mailing list > > Facebooker-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > -- > Mike Mangino > http://www.elevatedrails.com > > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk >-- http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com
Does it work if you change it to a form with a button and use :html => { :method => :delete } ? Shane On Thu, Feb 14, 2008 at 2:09 PM, Brian Howenstein <brian at hwrd.com> wrote:> I sent this question out about a week ago, but never got a response... > > I have so far been unable to do a RESTful delete using Facebooker. > > In my config/routes.rb, I have: > > map.resources :runs > > I am trying to do the delete using: > > <%= link_to "Delete", run, :method => :delete %> > > However, instead of doing the ''delete'', it calls the ''show'' action. > > Has anyone been successful doing a RESTful delete using Facebooker? > > Thanks, > Brian > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk >-- http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com
Facebook seems to always use POST for canvas page calls, but I did see this: http://www.henriquez.net/2007/09/so-you-start-new-ruby-on-rails.html --simon> Does it work if you change it to a form with a button and use :html => > { :method => :delete } ? > > Shane > > On Thu, Feb 14, 2008 at 2:09 PM, Brian Howenstein <brian at > hwrd.com> wrote: > > I sent this question out about a week ago, but never got a > response... > > > > I have so far been unable to do a RESTful delete using Facebooker. > > > > In my config/routes.rb, I have: > > > > map.resources :runs > > > > I am trying to do the delete using: > > > > <%= link_to "Delete", run, :method => :delete %> > > > > However, instead of doing the ''delete'', it calls the ''show'' action. > > > > Has anyone been successful doing a RESTful delete using Facebooker? > > > > Thanks, > > Brian-- http://simonwoodside.com