<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: How to write a Ruby and Rails 3 REST API</title>
	<atom:link href="http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/feed/" rel="self" type="application/rss+xml" />
	<link>http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/</link>
	<description>I&#039;m from the valley of the heavy heads.</description>
	<lastBuildDate>Tue, 07 May 2013 17:59:32 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: bacalao de calidad</title>
		<link>http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/comment-page-1/#comment-7472</link>
		<dc:creator>bacalao de calidad</dc:creator>
		<pubDate>Wed, 06 Mar 2013 09:39:16 +0000</pubDate>
		<guid isPermaLink="false">http://squarism.com/?p=1131#comment-7472</guid>
		<description><![CDATA[I go to see daily a few websites and blogs to read articles, but this 
blog presents quality based posts.]]></description>
		<content:encoded><![CDATA[<p>I go to see daily a few websites and blogs to read articles, but this<br />
blog presents quality based posts.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pravin</title>
		<link>http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/comment-page-1/#comment-7004</link>
		<dc:creator>Pravin</dc:creator>
		<pubDate>Tue, 05 Jun 2012 15:24:25 +0000</pubDate>
		<guid isPermaLink="false">http://squarism.com/?p=1131#comment-7004</guid>
		<description><![CDATA[Thanks a lot, Extremely concise and understandable. Clear idea about API and gem. Many many thanks for your time. keep going............]]></description>
		<content:encoded><![CDATA[<p>Thanks a lot, Extremely concise and understandable. Clear idea about API and gem. Many many thanks for your time. keep going&#8230;&#8230;&#8230;&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ines</title>
		<link>http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/comment-page-1/#comment-6979</link>
		<dc:creator>ines</dc:creator>
		<pubDate>Fri, 25 May 2012 09:26:24 +0000</pubDate>
		<guid isPermaLink="false">http://squarism.com/?p=1131#comment-6979</guid>
		<description><![CDATA[great tuto 
just a question ,can it a mobile client (webapp) interact with your example it means consume this restful web service ??
and again it&#039;s a good tutorial which help me a lot 
thanks a lot :))]]></description>
		<content:encoded><![CDATA[<p>great tuto<br />
just a question ,can it a mobile client (webapp) interact with your example it means consume this restful web service ??<br />
and again it&#8217;s a good tutorial which help me a lot<br />
thanks a lot :))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/comment-page-1/#comment-6961</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Sun, 13 May 2012 18:01:35 +0000</pubDate>
		<guid isPermaLink="false">http://squarism.com/?p=1131#comment-6961</guid>
		<description><![CDATA[UPDATE -- just figured out why the xml isn&#039;t showing up after some googling!

Maybe the OP can correct me if I&#039;m wrong, but you&#039;ll need to add a format to the controller file for the model you&#039;re using. Just edit the  controller file and add

format.xml{ render xml: @model_name }

after the format.html. There should be one there fore json that&#039;s why you&#039;re getting json results and html results. Try again and it should work :)]]></description>
		<content:encoded><![CDATA[<p>UPDATE &#8212; just figured out why the xml isn&#8217;t showing up after some googling!</p>
<p>Maybe the OP can correct me if I&#8217;m wrong, but you&#8217;ll need to add a format to the controller file for the model you&#8217;re using. Just edit the  controller file and add</p>
<p>format.xml{ render xml: @model_name }</p>
<p>after the format.html. There should be one there fore json that&#8217;s why you&#8217;re getting json results and html results. Try again and it should work :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/comment-page-1/#comment-6960</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Sun, 13 May 2012 17:47:15 +0000</pubDate>
		<guid isPermaLink="false">http://squarism.com/?p=1131#comment-6960</guid>
		<description><![CDATA[@cam - Are you running mysql from the mysql command line? or just typing mysql &gt; into the CL on linux/windows? if so, you gotta start the mysql command line

@moosya - ditto... any help on this matter would be excellent! I&#039;m getting an error that says &quot;error on line 1 at column 1: Extra content at the end of the document&quot;... I hit ctrl+u and it&#039;s empty source code.]]></description>
		<content:encoded><![CDATA[<p>@cam &#8211; Are you running mysql from the mysql command line? or just typing mysql &gt; into the CL on linux/windows? if so, you gotta start the mysql command line</p>
<p>@moosya &#8211; ditto&#8230; any help on this matter would be excellent! I&#8217;m getting an error that says &#8220;error on line 1 at column 1: Extra content at the end of the document&#8221;&#8230; I hit ctrl+u and it&#8217;s empty source code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: moosya</title>
		<link>http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/comment-page-1/#comment-6939</link>
		<dc:creator>moosya</dc:creator>
		<pubDate>Fri, 20 Apr 2012 11:20:10 +0000</pubDate>
		<guid isPermaLink="false">http://squarism.com/?p=1131#comment-6939</guid>
		<description><![CDATA[Great post!  thanks!

For some reason when I query for the &quot;.xml&quot; content nothing is returned
So, for example, this cmd does not work curl http://localhost:3000/employees.xml
but the same one w/o the &quot;.xml&quot; returns the html.

Is there a special command or flag to ensure that xml is generated also?]]></description>
		<content:encoded><![CDATA[<p>Great post!  thanks!</p>
<p>For some reason when I query for the &#8220;.xml&#8221; content nothing is returned<br />
So, for example, this cmd does not work curl <a href="http://localhost:3000/employees.xml" rel="nofollow">http://localhost:3000/employees.xml</a><br />
but the same one w/o the &#8220;.xml&#8221; returns the html.</p>
<p>Is there a special command or flag to ensure that xml is generated also?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cam</title>
		<link>http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/comment-page-1/#comment-6905</link>
		<dc:creator>cam</dc:creator>
		<pubDate>Thu, 22 Mar 2012 04:38:02 +0000</pubDate>
		<guid isPermaLink="false">http://squarism.com/?p=1131#comment-6905</guid>
		<description><![CDATA[Thanks for posting this!

I&#039;m sure I&quot;m missing something easy, but I&#039;m hung up after getting mysql2 installed. I&#039;m in my app&#039;s root directory and I&#039;m using bash. When I try to create the database I get a bash error saying command not found. Any suggestions?

$ mysql&gt; create database rest_api
-bash: mysql: command not found]]></description>
		<content:encoded><![CDATA[<p>Thanks for posting this!</p>
<p>I&#8217;m sure I&#8221;m missing something easy, but I&#8217;m hung up after getting mysql2 installed. I&#8217;m in my app&#8217;s root directory and I&#8217;m using bash. When I try to create the database I get a bash error saying command not found. Any suggestions?</p>
<p>$ mysql&gt; create database rest_api<br />
-bash: mysql: command not found</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TD</title>
		<link>http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/comment-page-1/#comment-6874</link>
		<dc:creator>TD</dc:creator>
		<pubDate>Fri, 02 Mar 2012 19:26:04 +0000</pubDate>
		<guid isPermaLink="false">http://squarism.com/?p=1131#comment-6874</guid>
		<description><![CDATA[How hard would it be to turn this XML to JSON?  Great Article either way!

---
Akshay,

This tutorial would do exactly what you need.  It sends an xml file to the Server (host/url) for you; instead of CURL.]]></description>
		<content:encoded><![CDATA[<p>How hard would it be to turn this XML to JSON?  Great Article either way!</p>
<p>&#8212;<br />
Akshay,</p>
<p>This tutorial would do exactly what you need.  It sends an xml file to the Server (host/url) for you; instead of CURL.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Akshay</title>
		<link>http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/comment-page-1/#comment-6840</link>
		<dc:creator>Akshay</dc:creator>
		<pubDate>Sat, 04 Feb 2012 09:25:07 +0000</pubDate>
		<guid isPermaLink="false">http://squarism.com/?p=1131#comment-6840</guid>
		<description><![CDATA[Hi There,

I would like to send .xml files to  web service. I have been able to generate/write xml into a file and would like to use that file to be sent over HTTP.

My curl command is something like 
curl -F &quot;SUBMISSION=@submission.xml&quot; -F &quot;STUDY=@study.xml&quot; -F &quot;SAMPLE=@sample.xml&quot; &quot;https://somesite.com/submit/box&quot;

Is it possible using the tutorial you have explained. 

Thank you]]></description>
		<content:encoded><![CDATA[<p>Hi There,</p>
<p>I would like to send .xml files to  web service. I have been able to generate/write xml into a file and would like to use that file to be sent over HTTP.</p>
<p>My curl command is something like<br />
curl -F &#8220;SUBMISSION=@submission.xml&#8221; -F &#8220;STUDY=@study.xml&#8221; -F &#8220;SAMPLE=@sample.xml&#8221; &#8220;https://somesite.com/submit/box&#8221;</p>
<p>Is it possible using the tutorial you have explained. </p>
<p>Thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/comment-page-1/#comment-6836</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Wed, 01 Feb 2012 20:42:06 +0000</pubDate>
		<guid isPermaLink="false">http://squarism.com/?p=1131#comment-6836</guid>
		<description><![CDATA[Thanks for this tutorial! I was completely in the dark about how XML requests would work in Rails but now I&#039;ve got an inkling.]]></description>
		<content:encoded><![CDATA[<p>Thanks for this tutorial! I was completely in the dark about how XML requests would work in Rails but now I&#8217;ve got an inkling.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/comment-page-1/#comment-6721</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Thu, 27 Oct 2011 00:29:13 +0000</pubDate>
		<guid isPermaLink="false">http://squarism.com/?p=1131#comment-6721</guid>
		<description><![CDATA[@Dillon, the server console gave me a clue with &quot;Processing by EmployeesController#show as XML&quot;. In the employees_controller.rb, I added the line &quot;format.xml { render :xml =&gt; @employee }&quot; in the show def. Interesting... I can curl with .json extension and I get the format that&#039;s been requested for the project I&#039;m working on.]]></description>
		<content:encoded><![CDATA[<p>@Dillon, the server console gave me a clue with &#8220;Processing by EmployeesController#show as XML&#8221;. In the employees_controller.rb, I added the line &#8220;format.xml { render :xml =&gt; @employee }&#8221; in the show def. Interesting&#8230; I can curl with .json extension and I get the format that&#8217;s been requested for the project I&#8217;m working on.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/comment-page-1/#comment-6720</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Thu, 27 Oct 2011 00:01:15 +0000</pubDate>
		<guid isPermaLink="false">http://squarism.com/?p=1131#comment-6720</guid>
		<description><![CDATA[@Dillon, Thanks, I was brain dead, and not typing &quot;ruby&quot; before the command. Create works, but the other 3 - no luck. I went back to the curl .../employees.xml, I get nothing. If I use the curl command omitting .xml, I get a response with the html. Ruby 1.8.7 (I did add the require above), gem 1.8.11 and Rails 3.1.1

Thanks for your help. This has been a great boost in my learning RoR!]]></description>
		<content:encoded><![CDATA[<p>@Dillon, Thanks, I was brain dead, and not typing &#8220;ruby&#8221; before the command. Create works, but the other 3 &#8211; no luck. I went back to the curl &#8230;/employees.xml, I get nothing. If I use the curl command omitting .xml, I get a response with the html. Ruby 1.8.7 (I did add the require above), gem 1.8.11 and Rails 3.1.1</p>
<p>Thanks for your help. This has been a great boost in my learning RoR!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dillon</title>
		<link>http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/comment-page-1/#comment-6719</link>
		<dc:creator>Dillon</dc:creator>
		<pubDate>Wed, 26 Oct 2011 18:16:32 +0000</pubDate>
		<guid isPermaLink="false">http://squarism.com/?p=1131#comment-6719</guid>
		<description><![CDATA[@Chris: See the step &quot;Create a file named api_client.rb in the root of the rest_api rails app&quot;.  Then open a Terminal (shell) or command prompt (Windows), run the script.  IE:  1) $ cd /where_you_put_your_rails_app  2) $ ruby api_client.rb  .  If the script doesn&#039;t run, make sure ruby is in your path.  If you have other problems, just respond.]]></description>
		<content:encoded><![CDATA[<p>@Chris: See the step &#8220;Create a file named api_client.rb in the root of the rest_api rails app&#8221;.  Then open a Terminal (shell) or command prompt (Windows), run the script.  IE:  1) $ cd /where_you_put_your_rails_app  2) $ ruby api_client.rb  .  If the script doesn&#8217;t run, make sure ruby is in your path.  If you have other problems, just respond.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/comment-page-1/#comment-6718</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Wed, 26 Oct 2011 16:55:05 +0000</pubDate>
		<guid isPermaLink="false">http://squarism.com/?p=1131#comment-6718</guid>
		<description><![CDATA[&quot;Now run with ruby api_client.rb and you should see:&quot; I&#039;ve obviously missed something. If I run read from terminal in /rest_api, it just looks at me. What am I supposed to run?]]></description>
		<content:encoded><![CDATA[<p>&#8220;Now run with ruby api_client.rb and you should see:&#8221; I&#8217;ve obviously missed something. If I run read from terminal in /rest_api, it just looks at me. What am I supposed to run?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ronaldo</title>
		<link>http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/comment-page-1/#comment-6628</link>
		<dc:creator>Ronaldo</dc:creator>
		<pubDate>Sat, 20 Aug 2011 19:19:34 +0000</pubDate>
		<guid isPermaLink="false">http://squarism.com/?p=1131#comment-6628</guid>
		<description><![CDATA[ok, rigth. thanks!]]></description>
		<content:encoded><![CDATA[<p>ok, rigth. thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dillon</title>
		<link>http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/comment-page-1/#comment-6622</link>
		<dc:creator>Dillon</dc:creator>
		<pubDate>Mon, 15 Aug 2011 14:19:32 +0000</pubDate>
		<guid isPermaLink="false">http://squarism.com/?p=1131#comment-6622</guid>
		<description><![CDATA[@Ronaldo, Yes you can use webservices to bridge languages.  .NET can consume a webservice as a REST client and Rails can serve the REST service.]]></description>
		<content:encoded><![CDATA[<p>@Ronaldo, Yes you can use webservices to bridge languages.  .NET can consume a webservice as a REST client and Rails can serve the REST service.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ronaldo</title>
		<link>http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/comment-page-1/#comment-6621</link>
		<dc:creator>Ronaldo</dc:creator>
		<pubDate>Mon, 15 Aug 2011 00:32:41 +0000</pubDate>
		<guid isPermaLink="false">http://squarism.com/?p=1131#comment-6621</guid>
		<description><![CDATA[Hi.
Thank you so much. This example helps a lot.
A question: i could send the xml file to web service built in .net, for example?]]></description>
		<content:encoded><![CDATA[<p>Hi.<br />
Thank you so much. This example helps a lot.<br />
A question: i could send the xml file to web service built in .net, for example?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQUARISM »until lambs become lions How to write a Ruby and Rails 3 REST API &#171; Chandara</title>
		<link>http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/comment-page-1/#comment-6618</link>
		<dc:creator>SQUARISM »until lambs become lions How to write a Ruby and Rails 3 REST API &#171; Chandara</dc:creator>
		<pubDate>Sat, 13 Aug 2011 04:36:44 +0000</pubDate>
		<guid isPermaLink="false">http://squarism.com/?p=1131#comment-6618</guid>
		<description><![CDATA[[...] : http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/  0.000000 0.000000 Share this:FacebookTwitterLinkedInEmailPrintLike this:LikeBe the first to like [...]]]></description>
		<content:encoded><![CDATA[<p>[...] : <a href="http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/" rel="nofollow">http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/</a>  0.000000 0.000000 Share this:FacebookTwitterLinkedInEmailPrintLike this:LikeBe the first to like [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dillon</title>
		<link>http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/comment-page-1/#comment-5885</link>
		<dc:creator>Dillon</dc:creator>
		<pubDate>Tue, 12 Apr 2011 02:36:31 +0000</pubDate>
		<guid isPermaLink="false">http://squarism.com/?p=1131#comment-5885</guid>
		<description><![CDATA[That&#039;s true.  1.8.7 needs the rubygems require.  1.9 does not.  Thanks for the feedback!]]></description>
		<content:encoded><![CDATA[<p>That&#8217;s true.  1.8.7 needs the rubygems require.  1.9 does not.  Thanks for the feedback!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mpurdy</title>
		<link>http://squarism.com/2011/04/01/how-to-write-a-ruby-rails-3-rest-api/comment-page-1/#comment-5884</link>
		<dc:creator>mpurdy</dc:creator>
		<pubDate>Mon, 11 Apr 2011 23:48:38 +0000</pubDate>
		<guid isPermaLink="false">http://squarism.com/?p=1131#comment-5884</guid>
		<description><![CDATA[create tutorial!

i am new to ruby/rails (come from a c/c++/corba, java/rmi/jee/spring background).

everything was easy to understand and everything ran as define with the exception of the client.

i had to add the require &#039;rubygems&#039; before it would run (see below).  however, i am using snow leapord with ruby 1.8.7 and gem 1.3.7

require &#039;./lib/api.rb&#039;
require &#039;rubygems&#039;
require &#039;nokogiri&#039;

again great tutorial; just added in case someone else had the same problem.]]></description>
		<content:encoded><![CDATA[<p>create tutorial!</p>
<p>i am new to ruby/rails (come from a c/c++/corba, java/rmi/jee/spring background).</p>
<p>everything was easy to understand and everything ran as define with the exception of the client.</p>
<p>i had to add the require &#8216;rubygems&#8217; before it would run (see below).  however, i am using snow leapord with ruby 1.8.7 and gem 1.3.7</p>
<p>require &#8216;./lib/api.rb&#8217;<br />
require &#8216;rubygems&#8217;<br />
require &#8216;nokogiri&#8217;</p>
<p>again great tutorial; just added in case someone else had the same problem.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
