<?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>ninajansen.dk &#187; REST</title>
	<atom:link href="http://ninajansen.dk/category/rest/feed/" rel="self" type="application/rss+xml" />
	<link>http://ninajansen.dk</link>
	<description></description>
	<lastBuildDate>Thu, 23 Apr 2009 21:46:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>In place editing in rails</title>
		<link>http://ninajansen.dk/2008/05/13/in-place-editing-in-rails/</link>
		<comments>http://ninajansen.dk/2008/05/13/in-place-editing-in-rails/#comments</comments>
		<pubDate>Tue, 13 May 2008 17:06:01 +0000</pubDate>
		<dc:creator>Nina Jansen</dc:creator>
				<category><![CDATA[REST]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ninajansen.dk/?p=32</guid>
		<description><![CDATA[So basically, the official plugin is old and cant really deal with restful routing. For some reason, when I used the url_for method in my views, the in place editor javascript function couldn&#8217;t interpret the (restful) route properly and sent a post request to &#8216;/controller/1/edit&#8217; to an action named &#8220;1&#8243; with an id set to [...]]]></description>
			<content:encoded><![CDATA[<p>So basically, the official plugin is old and cant really deal with restful routing. For some reason, when I used the url_for method in my views, the in place editor javascript function couldn&#8217;t interpret the (restful) route properly and sent a post request to &#8216;/controller/1/edit&#8217; to an action named &#8220;1&#8243; with an id set to &#8220;edit&#8221;, which obviously didn&#8217;t do anything useful. So instead I called the in place editor script in the following manner (I&#8217;m using haml btw.):</p>
<p><code><br />
%span{:id =&gt; "name", :class =&gt; "in_place_editor_field"}= @user.name<br />
= in_place_editor "name", {:url =&gt; '/user/edit/' + @user.id.to_s, :rows =&gt; 1, :size =&gt; 32 }<br />
</code></p>
<p>So basically I hard coded the route so it would fall back on standard routing. Yes I know that:</p>
<ul>
<li> This is ugly as sin</li>
<li> I&#8217;m supposed to do a PUT request to a function named update, not a post request to a function named edit.</li>
</ul>
<p>But it solved the problem.</p>
<img src="http://ninajansen.dk/?ak_action=api_record_view&id=32&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://ninajansen.dk/2008/05/13/in-place-editing-in-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
