Christopher Bailey
2008-Mar-04 19:12 UTC
[Facebooker-talk] How to build URL''s in models/outside controller/view code?
I''m building FBML in an asynchronous process, which is spawned from model code. There is no associated HTTP request, and thus no controller or view facilities available. I''m wondering if others do this, and what you recommend for building URL''s (e.g. with lack of link_to and url_for, etc.)? -- Christopher Bailey Cobalt Edge LLC http://cobaltedge.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080304/3ac00420/attachment.html
David Clements
2008-Mar-04 19:22 UTC
[Facebooker-talk] How to build URL''s in models/outside controller/view code?
The new Publisher Api supports this have you looked at that? You have access to all the view helpers and url_for. Are you pushing profile fbml? It supports that. Dave On Tue, Mar 4, 2008 at 12:12 PM, Christopher Bailey <chris at cobaltedge.com> wrote:> I''m building FBML in an asynchronous process, which is spawned from model > code. There is no associated HTTP request, and thus no controller or view > facilities available. I''m wondering if others do this, and what you > recommend for building URL''s (e.g. with lack of link_to and url_for, etc.)? > > -- > Christopher Bailey > Cobalt Edge LLC > http://cobaltedge.com > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > >
Michael Niessner
2008-Mar-04 19:43 UTC
[Facebooker-talk] How to build URL''s in models/outside controller/view code?
Like Dave said definitely check out the publisher api. If for some reason that isn''t what you want, take a look at http://api.rubyonrails.org/classes/ActionController/UrlWriter.html to see how to include url helpers in any class. Michael Niessner On Mar 4, 2008, at 1:22 PM, David Clements wrote:> The new Publisher Api supports this have you looked at that? You have > access to all the view helpers and url_for. > > Are you pushing profile fbml? It supports that. > > Dave > > > On Tue, Mar 4, 2008 at 12:12 PM, Christopher Bailey > <chris at cobaltedge.com> wrote: >> I''m building FBML in an asynchronous process, which is spawned from >> model >> code. There is no associated HTTP request, and thus no controller >> or view >> facilities available. I''m wondering if others do this, and what you >> recommend for building URL''s (e.g. with lack of link_to and >> url_for, etc.)? >> >> -- >> Christopher Bailey >> Cobalt Edge LLC >> http://cobaltedge.com >> _______________________________________________ >> 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
Christopher Bailey
2008-Mar-04 20:45 UTC
[Facebooker-talk] How to build URL''s in models/outside controller/view code?
Ah, thanks for reminding me about that! Ok, I''m trying to use it now. I''ve built my class to publish a profile update for a user, as per Mike''s message (in his response to you putting up the tutorial). But, when I call FacebookPublisher.deliver_profile_update(user), I get see this: NoMethodError (undefined method `send!'' for #<Module:0x439da10>): .//vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:263:in `inherited'' .//app/models/facebook_publisher.rb:1 Any ideas before I dig in further? I''m using the latest Facebooker (rev 200). On 3/4/08, David Clements <digidigo at gmail.com> wrote:> > The new Publisher Api supports this have you looked at that? You have > access to all the view helpers and url_for. > > Are you pushing profile fbml? It supports that. > > Dave > > > > On Tue, Mar 4, 2008 at 12:12 PM, Christopher Bailey > <chris at cobaltedge.com> wrote: > > I''m building FBML in an asynchronous process, which is spawned from > model > > code. There is no associated HTTP request, and thus no controller or > view > > facilities available. I''m wondering if others do this, and what you > > recommend for building URL''s (e.g. with lack of link_to and url_for, > etc.)? > > > > -- > > Christopher Bailey > > Cobalt Edge LLC > > http://cobaltedge.com > > > _______________________________________________ > > Facebooker-talk mailing list > > Facebooker-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > >-- Christopher Bailey Cobalt Edge LLC http://cobaltedge.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080304/74050967/attachment.html
Christopher Bailey
2008-Mar-04 22:10 UTC
[Facebooker-talk] How to build URL''s in models/outside controller/view code?
Well, it appears the fix for this was simply to change the call from "send!" to be "send" instead. My story gets sent that way. Is send! a Rails 2 addition possibly? I''m using Rails 1.2.3. On 3/4/08, Christopher Bailey <chris at cobaltedge.com> wrote:> > Ah, thanks for reminding me about that! Ok, I''m trying to use it now. > I''ve built my class to publish a profile update for a user, as per Mike''s > message (in his response to you putting up the tutorial). But, when I call > FacebookPublisher.deliver_profile_update(user), I get see this: > > NoMethodError (undefined method `send!'' for #<Module:0x439da10>): > .//vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:263:in > `inherited'' > .//app/models/facebook_publisher.rb:1 > > > Any ideas before I dig in further? I''m using the latest Facebooker (rev > 200). > > On 3/4/08, David Clements <digidigo at gmail.com> wrote: > > > > The new Publisher Api supports this have you looked at that? You have > > access to all the view helpers and url_for. > > > > Are you pushing profile fbml? It supports that. > > > > Dave > > > > > > > > On Tue, Mar 4, 2008 at 12:12 PM, Christopher Bailey > > <chris at cobaltedge.com> wrote: > > > I''m building FBML in an asynchronous process, which is spawned from > > model > > > code. There is no associated HTTP request, and thus no controller or > > view > > > facilities available. I''m wondering if others do this, and what you > > > recommend for building URL''s (e.g. with lack of link_to and url_for, > > etc.)? > > > > > > -- > > > Christopher Bailey > > > Cobalt Edge LLC > > > http://cobaltedge.com > > > > > _______________________________________________ > > > Facebooker-talk mailing list > > > Facebooker-talk at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > > > > > > > > > -- > Christopher Bailey > Cobalt Edge LLC > http://cobaltedge.com >-- Christopher Bailey Cobalt Edge LLC http://cobaltedge.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080304/457a75e2/attachment.html
Christopher Bailey
2008-Mar-05 04:46 UTC
[Facebooker-talk] How to build URL''s in models/outside controller/view code?
Further followup... So, the Publisher solution doesn''t seem to actually solve my need for URL generation. link_to, url_for, image_tag, and so on don''t seem to work (I get various undefined method errors for methods they use, etc.). Is that expected, or? On 3/4/08, Christopher Bailey <chris at cobaltedge.com> wrote:> > Well, it appears the fix for this was simply to change the call from > "send!" to be "send" instead. My story gets sent that way. Is send! a > Rails 2 addition possibly? I''m using Rails 1.2.3. > > On 3/4/08, Christopher Bailey <chris at cobaltedge.com> wrote: > > > > Ah, thanks for reminding me about that! Ok, I''m trying to use it now. > > I''ve built my class to publish a profile update for a user, as per Mike''s > > message (in his response to you putting up the tutorial). But, when I call > > FacebookPublisher.deliver_profile_update(user), I get see this: > > > > NoMethodError (undefined method `send!'' for #<Module:0x439da10>): > > > > .//vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:263:in > > `inherited'' > > .//app/models/facebook_publisher.rb:1 > > > > > > Any ideas before I dig in further? I''m using the latest Facebooker (rev > > 200). > > > > On 3/4/08, David Clements <digidigo at gmail.com> wrote: > > > > > > The new Publisher Api supports this have you looked at that? You have > > > access to all the view helpers and url_for. > > > > > > Are you pushing profile fbml? It supports that. > > > > > > Dave > > > > > > > > > > > > On Tue, Mar 4, 2008 at 12:12 PM, Christopher Bailey > > > <chris at cobaltedge.com> wrote: > > > > I''m building FBML in an asynchronous process, which is spawned from > > > model > > > > code. There is no associated HTTP request, and thus no controller > > > or view > > > > facilities available. I''m wondering if others do this, and what you > > > > recommend for building URL''s (e.g. with lack of link_to and url_for, > > > etc.)? > > > > > > > > -- > > > > Christopher Bailey > > > > Cobalt Edge LLC > > > > http://cobaltedge.com > > > > > > > _______________________________________________ > > > > Facebooker-talk mailing list > > > > Facebooker-talk at rubyforge.org > > > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > > > > > > > > > > > > > > > > -- > > Christopher Bailey > > Cobalt Edge LLC > > http://cobaltedge.com > > > > > > -- > Christopher Bailey > Cobalt Edge LLC > http://cobaltedge.com >-- Christopher Bailey Cobalt Edge LLC http://cobaltedge.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080304/5c90dc45/attachment-0001.html