<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Betty&#039;s Blog :]</title>
	<atom:link href="http://betty.multimediatechnology.at/feed/" rel="self" type="application/rss+xml" />
	<link>http://betty.multimediatechnology.at</link>
	<description>stay hungry &#124; stay foolish</description>
	<lastBuildDate>Sat, 26 Dec 2009 17:07:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>RubyOnRails-Applikation für Facebook deployen</title>
		<link>http://betty.multimediatechnology.at/2009/12/rubyonrails-applikation-fur-facebook-deployen/</link>
		<comments>http://betty.multimediatechnology.at/2009/12/rubyonrails-applikation-fur-facebook-deployen/#comments</comments>
		<pubDate>Sat, 26 Dec 2009 15:57:30 +0000</pubDate>
		<dc:creator>Betty</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[QPT]]></category>
		<category><![CDATA[RubyOnRails]]></category>
		<category><![CDATA[Deployment]]></category>

		<guid isPermaLink="false">http://betty.multimediatechnology.at/?p=15</guid>
		<description><![CDATA[Du brauchst:
- RubyOnRails Projekt
- eine leere Facebook Applikation
- Webserver (Vorrausetzung: du kannst dein RubyOnRails Projekt schon deployen)
public/index.html löschen und map.root in der config/routes.rb festlegen
Facebook Applikation Einstellungen:
Canvas Callback URLhttp://example.com/
Connect-URLhttp://example.com/
Canvas URLhttp://apps.facebook.com/applikationname/
Use FBML

Facebooker installieren:
ruby script/plugin install git://github.com/mmangino/facebooker.git
im Ruby-Projekt eine config/facebooker.yml erstellen: Vorlage
api_key Dein API key von Facebook
secret_key Der Schlüssel deiner Facebook-Applikation
canvas_page_name Adresse deiner Facebook-Applikation
Ruby-Projekt-Einstellungen:
in der config/routes.rb muss canvas [...]]]></description>
			<content:encoded><![CDATA[<h3><strong>Du brauchst:</strong></h3>
<p>- RubyOnRails Projekt<br />
- eine leere Facebook Applikation<br />
- Webserver (Vorrausetzung: du kannst dein RubyOnRails Projekt schon deployen)</p>
<p>public/index.html löschen und map.root in der config/routes.rb festlegen</p>
<h3><strong>Facebook Applikation Einstellungen:</strong></h3>
<p>Canvas Callback URL<br />http://example.com/</p>
<p>Connect-URL<br />http://example.com/</p>
<p>Canvas URL<br />http://apps.facebook.com/applikationname/</p>
<p>Use FBML</p>
<p><span id="more-15"></span></p>
<h3><strong>Facebooker installieren:</strong></h3>
<pre>ruby script/plugin install git://github.com/mmangino/facebooker.git</pre>
<p>im Ruby-Projekt eine config/facebooker.yml erstellen: <strong><a href="http://apps.facebook.com/facebooker_tutorial/" target="_blank">Vorlage</a></strong></p>
<p><strong>api_key</strong> Dein API key von Facebook<br />
<strong>secret_key</strong> Der Schlüssel deiner Facebook-Applikation<strong><br />
canvas_page_name</strong> Adresse deiner Facebook-Applikation</p>
<h3><strong>Ruby-Projekt-Einstellungen:</strong></h3>
<p>in der config/routes.rb muss canvas auf true gesetzt werden, damit die Applikation auf Facebook funktionieren kann</p>
<pre>map.resources :articles, :conditions =&gt; {:canvas =&gt; true}</pre>
<p>Nun ist unser Controller richtig verbunden, aber wahrscheinlich kommt dann der HTTP Fehler 406 beim Aufrufen der App (http://apps.facebook.com/applikationname/).</p>
<p><!--<br />
Das Format muss noch für den Webserver geändert werden! Öffne  config/initializers/mime_types.rb und füge folgende Zeile hinzu:</p>
<pre>Mime::Type.register_alias &#8220;text/html&#8221;, :fbml</pre>
<p>Server neustarten!<br />
--><br />
FBML wird nun mit Rails arbeiten können, aber die App kann trotzdem noch keine FBML-Seiten ausgeben. Nun müssen in den Controller-Dateien jedes format.html in format.fbml umgeändert werden.</p>
<p>Zum Beispiel: app/controllers/articles_controller.rb</p>
<pre>def index
@articles= Articles.find(:all)</pre>
<pre>  respond_to do |format|</pre>
<pre>    format.fbml # index.fbml.erb</pre>
<pre>    format.xml  { render : xml =&gt; @articles}</pre>
<pre>  end</pre>
<pre>end</pre>
<p>Der letzte Schritt ist nun alle view-Dateien umzubennen!</p>
<p>Also alle Dateien in den Unterordnern des views-Ordners von <strong>*.html.erb zu *.fbml.erb</strong> umbennen!<br />
Und die im views/layouts liegende Datei ändern, denn Facebook mag keinen body-tag usw</p>
<p>Am Ende bleibt nicht mehr viel ürbig in der app/views/layouts/application.fbml.erb:</p>
<pre>&lt;p style="color: green"&gt;&lt;%= flash[:notice] %&gt;&lt;/p&gt;
&lt;%= yield  %&gt;
</pre>
<p>&nbsp;</p>
<p><strong>Deployen</strong> (auf den Webserver laden) und schon sollte die Applikation funktionieren!</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>--&gt; <a href="http://www.ajaxlines.com/ajax/stuff/article/getting_started_with_facebooker.php" target="_blank">Weitere Infos</a></p>
]]></content:encoded>
			<wfw:commentRss>http://betty.multimediatechnology.at/2009/12/rubyonrails-applikation-fur-facebook-deployen/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
