Hey everyone. I''ve got a best practices question. How are you guys rendering newsfeeds? We have a couple of apps where we send newsfeed items from a backend process. As such, we aren''t in the context of a controller and can''t use the rails template rendering. We''ve tried about 3 different ways to make that bearable, but aren''t having much luck. Is anyone using a cool trick to get access to all of our great rails helpers? Mike -- Mike Mangino http://www.elevatedrails.com
hey Mike, I am using render_to_string and that seems to work well for me. Would that work ok for your situation? message_text = render_to_string(:template => ''facebook_accounts/ send_to_friend_message'', :layout => false) facebook_session.send_notification(@ids, message_text) unless @ids.empty? Later, Mark On Jan 10, 2008, at 10:07 AM, Mike Mangino wrote:> Hey everyone. I''ve got a best practices question. How are you guys > rendering newsfeeds? We have a couple of apps where we send newsfeed > items from a backend process. As such, we aren''t in the context of a > controller and can''t use the rails template rendering. We''ve tried > about 3 different ways to make that bearable, but aren''t having much > luck. Is anyone using a cool trick to get access to all of our great > rails helpers? > > Mike > -- > Mike Mangino > http://www.elevatedrails.com > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk
I have a two pronged approach to this. My situation is a little unique since we are integrating a free standing site into Facebook, so I have a lot of code that I don''t want to rewrite. 1) I am actually using ActionMailer rendering. The first thing I did was to create ActionMailer template for text/fbml. Then I hacked ARMailer to pull out any part that was ''text/fbml'' and use that content to send out. 2) I created a background Facebook communication process that works is a similar way to ar_mailer. It provides an API for create Stories, Actions and Emails to be sent to facebook. Then a background process , running from cron, pops these off the queue and uses Facebooker API to send them to facebook. I am not sure if the code is generally useful but let me know if you want to look at it and I will put it out on svn somewhere. Dave On Jan 10, 2008 9:13 AM, Heavy Sixer <heavysixer at gmail.com> wrote:> hey Mike, > I am using render_to_string and that seems to work well for me. Would > that work ok for your situation? > > message_text = render_to_string(:template => ''facebook_accounts/ > send_to_friend_message'', :layout => false) > facebook_session.send_notification(@ids, message_text) unless > @ids.empty? > > Later, > Mark > > > On Jan 10, 2008, at 10:07 AM, Mike Mangino wrote: > > > Hey everyone. I''ve got a best practices question. How are you guys > > rendering newsfeeds? We have a couple of apps where we send newsfeed > > items from a backend process. As such, we aren''t in the context of a > > controller and can''t use the rails template rendering. We''ve tried > > about 3 different ways to make that bearable, but aren''t having much > > luck. Is anyone using a cool trick to get access to all of our great > > rails helpers? > > > > Mike > > -- > > Mike Mangino > > http://www.elevatedrails.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 >
I have a two pronged approach to this. My situation is a little unique since we are integrating a free standing site into Facebook, so I have a lot of code that I don''t want to rewrite. 1) I am actually using ActionMailer rendering. The first thing I did was to create ActionMailer template for text/fbml. Then I hacked ARMailer to pull out any part that was ''text/fbml'' and use that content to send out. 2) I created a background Facebook communication process that works is a similar way to ar_mailer. It provides an API for create Stories, Actions and Emails to be sent to facebook. Then a background process , running from cron, pops these off the queue and uses Facebooker API to send them to facebook. I am not sure if the code is generally useful but let me know if you want to look at it and I will put it out on svn somewhere. Dave On Jan 10, 2008 9:13 AM, Heavy Sixer <heavysixer at gmail.com> wrote:> hey Mike, > I am using render_to_string and that seems to work well for me. Would > that work ok for your situation? > > message_text = render_to_string(:template => ''facebook_accounts/ > send_to_friend_message'', :layout => false) > facebook_session.send_notification(@ids, message_text) unless > @ids.empty? > > Later, > Mark > > > On Jan 10, 2008, at 10:07 AM, Mike Mangino wrote: > > > Hey everyone. I''ve got a best practices question. How are you guys > > rendering newsfeeds? We have a couple of apps where we send newsfeed > > items from a backend process. As such, we aren''t in the context of a > > controller and can''t use the rails template rendering. We''ve tried > > about 3 different ways to make that bearable, but aren''t having much > > luck. Is anyone using a cool trick to get access to all of our great > > rails helpers? > > > > Mike > > -- > > Mike Mangino > > http://www.elevatedrails.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 >