<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2913250</guid>
        <pubDate>Mon, 13 Jun 2011 08:40:27 +0000</pubDate>
        <title>RoR - возврат в XML формате &amp;#33;?</title>
        <link>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2913250</link>
        <description><![CDATA[Мохнатый: Вот:<br>Что-то не аттачится. Позже залью.]]></description>
        <author>Мохнатый</author>
        <category>Ruby</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2912638</guid>
        <pubDate>Fri, 10 Jun 2011 20:32:55 +0000</pubDate>
        <title>RoR - возврат в XML формате &amp;#33;?</title>
        <link>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2912638</link>
        <description><![CDATA[Megathrone: Вопрос не по теме, но все же задам здесь что бы ветку не засорять....<br>Есть ли у кого то книга &quot;Рецепты Rails&quot; в электронном варианте ? Если есть - залейте куда то &#33;<br>Спасибо &#33;]]></description>
        <author>Megathrone</author>
        <category>Ruby</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2912597</guid>
        <pubDate>Fri, 10 Jun 2011 18:12:30 +0000</pubDate>
        <title>RoR - возврат в XML формате &amp;#33;?</title>
        <link>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2912597</link>
        <description><![CDATA[Мохнатый: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=333212&view=findpost&p=2912137'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Megathrone &#064; <time class="tag-quote__quoted-time" datetime="2011-06-10T09:51:28+00:00">10.06.11, 09:51</time></span><div class='quote '>Так должно прокатить &#33;? </div></div><br>
В контроллере необязательно вызывать respond_to. Вытащил юзера и все. Вьюшку оформил правильно, посему тебе вернется твой xml.<br>
<br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=333212&view=findpost&p=2912350'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>deil &#064; <time class="tag-quote__quoted-time" datetime="2011-06-10T12:45:08+00:00">10.06.11, 12:45</time></span><div class='quote '>Откуда здесь переменная format&#33;?</div></div><br>
Верный вопрос, явно видно что там accepts. :)]]></description>
        <author>Мохнатый</author>
        <category>Ruby</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2912350</guid>
        <pubDate>Fri, 10 Jun 2011 12:45:08 +0000</pubDate>
        <title>RoR - возврат в XML формате &amp;#33;?</title>
        <link>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2912350</link>
        <description><![CDATA[deil: Возник вопрос:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;&nbsp; &nbsp;def post</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;@user = User.new(:login =&#62; params[:login], :email =&#62; params[:mail], :password =&#62; params[:password])</div><div class="code_line">&nbsp;&nbsp; &nbsp; </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;respond_to do |accepts|</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if @user.save</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;accepts.html</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;accepts.xml { render :xml =&#62; @user.to_xml(:except =&#62; [:created_at, :updated_at]) }</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;format.html { render :action =&#62; &quot;new&quot; }</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;format.xml &nbsp;{ render :xml =&#62; @user.errors, :status =&#62; :unprocessable_entity }</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end &nbsp; &nbsp; &nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;end</div><div class="code_line">&nbsp;&nbsp; &nbsp;end</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script><br>
<br>
Откуда здесь переменная format&#33;?]]></description>
        <author>deil</author>
        <category>Ruby</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2912137</guid>
        <pubDate>Fri, 10 Jun 2011 09:51:28 +0000</pubDate>
        <title>RoR - возврат в XML формате &amp;#33;?</title>
        <link>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2912137</link>
        <description><![CDATA[Megathrone: То есть можно так : <br>
в методе контроллера делаем<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;&nbsp; &nbsp;</div><div class="code_line">respond_to do |format|</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; format.xml &nbsp;{ render :xml =&#62; @user }</div><div class="code_line">end</div></ol></div></div></div></div><br>
<br>
а в соответствующей вюшке что то на подобие <br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">xml.instruct!</div><div class="code_line">&nbsp;</div><div class="code_line">xml.feed &quot;xmlns&quot; =&#62; &quot;http://www.w3.org/2005/Atom&quot; do</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;@user.each do |user|</div><div class="code_line">&nbsp;&nbsp; &nbsp;xml.entry do</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;xml.title &nbsp; user.title</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;xml.id &nbsp; &nbsp; &nbsp;url_for(:only_path =&#62; false, :controller =&#62; &#39;user&#39;, :action =&#62; &#39;show&#39;, :id =&#62; user.id)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;xml.mail &nbsp; &nbsp;user.name</div><div class="code_line">&nbsp;&nbsp; &nbsp;end</div><div class="code_line">&nbsp;&nbsp;end</div><div class="code_line">&nbsp;</div><div class="code_line">end</div></ol></div></div></div></div><br>
Соответственно сохраняем её как &lt;method_name&gt;.rxml &#33;&#33;&#33;<br>
<br>
Так должно прокатить &#33;?]]></description>
        <author>Megathrone</author>
        <category>Ruby</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2911111</guid>
        <pubDate>Thu, 09 Jun 2011 08:46:58 +0000</pubDate>
        <title>RoR - возврат в XML формате &amp;#33;?</title>
        <link>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2911111</link>
        <description><![CDATA[Мохнатый: Вариант 1<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">respond_to do |format|</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;format.xml &nbsp;{ render :xml =&#62; @user }</div><div class="code_line">&nbsp;&nbsp; &nbsp;end</div></ol></div></div></div></div><br>
<br>
Вариант 2<br>
<br>
Создать rxml темплейт вместо стандратной erb вьюшки. Вот это сработает на 250 процентов.]]></description>
        <author>Мохнатый</author>
        <category>Ruby</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2910555</guid>
        <pubDate>Wed, 08 Jun 2011 11:30:34 +0000</pubDate>
        <title>RoR - возврат в XML формате &amp;#33;?</title>
        <link>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2910555</link>
        <description><![CDATA[deil: Ну очень на то похоже.. <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2011-06-08T11:31:56+00:00">08.06.11, 11:31</time></span></span><br>
Если честно, меня этот код уже запутал  :lol: По сути, должен работать.<br>
Я бы почитал код accepts и format]]></description>
        <author>deil</author>
        <category>Ruby</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2910389</guid>
        <pubDate>Wed, 08 Jun 2011 09:30:23 +0000</pubDate>
        <title>RoR - возврат в XML формате &amp;#33;?</title>
        <link>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2910389</link>
        <description><![CDATA[Megathrone: Выходит что все таки нужно установить Accept: application/xml при формирование ПОСТ запроса, для того что бы в ответ получить XML &#33;?]]></description>
        <author>Megathrone</author>
        <category>Ruby</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2910362</guid>
        <pubDate>Wed, 08 Jun 2011 09:08:21 +0000</pubDate>
        <title>RoR - возврат в XML формате &amp;#33;?</title>
        <link>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2910362</link>
        <description><![CDATA[XandoX: понятно спасибо]]></description>
        <author>XandoX</author>
        <category>Ruby</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2910339</guid>
        <pubDate>Wed, 08 Jun 2011 08:47:22 +0000</pubDate>
        <title>RoR - возврат в XML формате &amp;#33;?</title>
        <link>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2910339</link>
        <description><![CDATA[deil: Ну глянь на роутинги: там прописано, что .xml в запросе /post.xml распарсится просто в переменную params[:format], не более того.<br>
respond_to же выбирает, что рендерить - как раз по полю Accept]]></description>
        <author>deil</author>
        <category>Ruby</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2910221</guid>
        <pubDate>Wed, 08 Jun 2011 07:01:18 +0000</pubDate>
        <title>RoR - возврат в XML формате &amp;#33;?</title>
        <link>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2910221</link>
        <description><![CDATA[XandoX: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=333212&view=findpost&p=2910197'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>deil &#064; <time class="tag-quote__quoted-time" datetime="2011-06-08T06:28:20+00:00">08.06.11, 06:28</time></span><div class='quote '>Не забываем, что чтобы в ответ вернулось XML и сработал соответствующий respond_to, необходимо явно в запросе об этом сказать. Что причем наглядно видно из кода&#33;<br>
URL вида post.xml с этим вообще никак не связан. <br>
</div></div><br>
то есть можно опустить все эти .xml и просто в http запросе установить заголовок типа Accept: application/xml? и все правильно вернется? (ну если конечно в коде это реализовано)]]></description>
        <author>XandoX</author>
        <category>Ruby</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2910197</guid>
        <pubDate>Wed, 08 Jun 2011 06:28:20 +0000</pubDate>
        <title>RoR - возврат в XML формате &amp;#33;?</title>
        <link>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2910197</link>
        <description><![CDATA[deil: Не забываем, что чтобы в ответ вернулось XML и сработал соответствующий respond_to, необходимо явно в запросе об этом сказать. Что причем наглядно видно из кода&#33;<br>
URL вида post.xml с этим вообще никак не связан. <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2011-06-08T06:30:46+00:00">08.06.11, 06:30</time></span></span><br>
Хотя, блин, код тут довольно хитроват..]]></description>
        <author>deil</author>
        <category>Ruby</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2910195</guid>
        <pubDate>Wed, 08 Jun 2011 06:25:26 +0000</pubDate>
        <title>RoR - возврат в XML формате &amp;#33;?</title>
        <link>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2910195</link>
        <description><![CDATA[XandoX: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=333212&view=findpost&p=2910048'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Megathrone &#064; <time class="tag-quote__quoted-time" datetime="2011-06-07T19:34:40+00:00">07.06.11, 19:34</time></span><div class='quote '>выходит я что то не так делаю</div></div><br>
ну есть немного<br>
<br>
в рельсах для управления ресурсами применяется (хрен знает как это называется) REST<br>
то есть когда ты в routes.rb делаешь map.resources :users у тебя автоматом создаются вот такие вот пути запросов<br>
<table class='post_table tag-table'><tr><th>HTTP метод</th><th>путь</th><th>метод контроллера</th><th>нужен, что бы</th></tr><tr><td>GET</td><td>/users</td><td>index</td><td>получить всех пользователей</td></tr><tr><td>GET</td><td>/users/new</td><td>new</td><td>рисует форму для нового пользователя</td></tr><tr><td>POST</td><td>/users</td><td>create</td><td>создает нового пользователя (как раз то что тебе и нужно)</td></tr><tr><td>GET</td><td>/users/:id</td><td>show</td><td>отдает информацию о конкретном пользователе</td></tr><tr><td>GET</td><td>/users/:id/edit</td><td>edit</td><td>рисует форму для редактирования пользователя</td></tr><tr><td>PUT</td><td>/users/:id</td><td>update</td><td>изменяет информацию о пользователе</td></tr><tr><td>DELETE</td><td>/users/:id</td><td>destroy</td><td>удаляет пользователя</td></tr></table><br>
<br>
То есть тебе надо вызвать POST /users (или POST /users.xml если у тебя данные о пользователе в xml), в методе create делать редирект на /users/:id.xml (id, ты уже должен занать, так как ты его только что построил) и если твой http клиент не умеет обрабатывать редиректы, то либо его надо научить либо обрабатывать это в ручную]]></description>
        <author>XandoX</author>
        <category>Ruby</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2910048</guid>
        <pubDate>Tue, 07 Jun 2011 19:34:40 +0000</pubDate>
        <title>RoR - возврат в XML формате &amp;#33;?</title>
        <link>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2910048</link>
        <description><![CDATA[Megathrone: если честно - тут уже я что то не понимаю ....<br>Я модель и все остальное создал с помощью scaffold - и в соответствующем контроллере добавил отдельный метод для POST запросов из вне, так сказать для наглядности .... выходит я что то не так делаю &#33;?]]></description>
        <author>Megathrone</author>
        <category>Ruby</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2909990</guid>
        <pubDate>Tue, 07 Jun 2011 18:12:20 +0000</pubDate>
        <title>RoR - возврат в XML формате &amp;#33;?</title>
        <link>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2909990</link>
        <description><![CDATA[XandoX: я может чего не понимаю<br>но ты объявляешь ресурс users а внем не должно быть экшена post <br>там полный REST http://guides.rubyonrails.org/routing.html#crud-verbs-and-actions]]></description>
        <author>XandoX</author>
        <category>Ruby</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2909947</guid>
        <pubDate>Tue, 07 Jun 2011 16:56:39 +0000</pubDate>
        <title>RoR - возврат в XML формате &amp;#33;?</title>
        <link>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2909947</link>
        <description><![CDATA[Megathrone: <div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">ActionController::Routing::Routes.draw do |map|</div><div class="code_line">&nbsp;&nbsp;map.resources :users</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;map.root :controller =&#62; &quot;home&quot;</div><div class="code_line">&nbsp;&nbsp;</div><div class="code_line">&nbsp;&nbsp;map.connect &#39;:controller/:service.wsdl&#39;, :action =&#62;&#39;wsdl&#39;</div><div class="code_line">&nbsp;&nbsp;map.connect &#39;:controller/:action/:id&#39;</div><div class="code_line">&nbsp;&nbsp;map.connect &#39;:controller/:action/:id.:format&#39;</div><div class="code_line">&nbsp;&nbsp;map.connect &#39;:controller/:action/:login&#39;</div><div class="code_line">&nbsp;&nbsp;map.connect &#39;:controller/:action/:login.:format&#39;</div></ol></div></div></div></div>]]></description>
        <author>Megathrone</author>
        <category>Ruby</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2909783</guid>
        <pubDate>Tue, 07 Jun 2011 13:01:21 +0000</pubDate>
        <title>RoR - возврат в XML формате &amp;#33;?</title>
        <link>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2909783</link>
        <description><![CDATA[XandoX: покажи routes.rb]]></description>
        <author>XandoX</author>
        <category>Ruby</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2909772</guid>
        <pubDate>Tue, 07 Jun 2011 12:52:03 +0000</pubDate>
        <title>RoR - возврат в XML формате &amp;#33;?</title>
        <link>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2909772</link>
        <description><![CDATA[Megathrone: Пробовал - выдает :<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">gafas@amd64:~/ruby-prj/test/client$ ruby client.rb </div><div class="code_line">Input Name :</div><div class="code_line">username</div><div class="code_line">Input Mail :</div><div class="code_line">username@mail.ru</div><div class="code_line">Input Pass :</div><div class="code_line">124sf12ts</div><div class="code_line">{:password=&#62;&quot;124sf12ts&quot;, :mail=&#62;&quot;username@mail.ru&quot;, :login=&#62;&quot;username&quot;}</div><div class="code_line">url is:http://localhost:3000/users/post.xml</div><div class="code_line">Request post ...</div><div class="code_line">Request post ... executed</div><div class="code_line">Request status = 405</div><div class="code_line">&#60;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&#62;</div><div class="code_line">&#60;head&#62;</div><div class="code_line">&nbsp;&nbsp;&#60;title&#62;Action Controller: Exception caught&#60;/title&#62;</div><div class="code_line">&nbsp;&nbsp;&#60;style&#62;</div><div class="code_line">&nbsp;&nbsp; &nbsp;body { background-color: #fff; color: #333; }</div><div class="code_line">&nbsp;&nbsp; &nbsp;body, p, ol, ul, td {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;font-family: verdana, arial, helvetica, sans-serif;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;font-size: &nbsp; 13px;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;line-height: 18px;</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;pre {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;background-color: #eee;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;padding: 10px;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;font-size: 11px;</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;a { color: #000; }</div><div class="code_line">&nbsp;&nbsp; &nbsp;a:visited { color: #666; }</div><div class="code_line">&nbsp;&nbsp; &nbsp;a:hover { color: #fff; background-color:#000; }</div><div class="code_line">&nbsp;&nbsp;&#60;/style&#62;</div><div class="code_line">&#60;/head&#62;</div><div class="code_line">&#60;body&#62;</div><div class="code_line">&#60;h1&#62;</div><div class="code_line">&nbsp;&nbsp;ActionController::MethodNotAllowed</div><div class="code_line">&nbsp;&nbsp;</div><div class="code_line">&#60;/h1&#62;</div><div class="code_line">&#60;pre&#62;Only get, put, and delete requests are allowed.&#60;/pre&#62;</div><div class="code_line">&#60;p&#62;&#60;code&#62;RAILS_ROOT: /home/gafas/ruby-prj/test&#60;/code&#62;&#60;/p&#62;</div><div class="code_line">&#60;div id=&quot;traces&quot;&#62;</div><div class="code_line">&nbsp;&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;&#60;a href=&quot;#&quot; onclick=&quot;document.getElementById(&#39;Framework-Trace&#39;).style.display=&#39;none&#39;;document.getElementById(&#39;Full-Trace&#39;).style.display=&#39;none&#39;;document.getElementById(&#39;Application-Trace&#39;).style.display=&#39;block&#39;;; return false;&quot;&#62;Application Trace&#60;/a&#62; |</div><div class="code_line">&nbsp;&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;&#60;a href=&quot;#&quot; onclick=&quot;document.getElementById(&#39;Application-Trace&#39;).style.display=&#39;none&#39;;document.getElementById(&#39;Full-Trace&#39;).style.display=&#39;none&#39;;document.getElementById(&#39;Framework-Trace&#39;).style.display=&#39;block&#39;;; return false;&quot;&#62;Framework Trace&#60;/a&#62; |</div><div class="code_line">&nbsp;&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;&#60;a href=&quot;#&quot; onclick=&quot;document.getElementById(&#39;Application-Trace&#39;).style.display=&#39;none&#39;;document.getElementById(&#39;Framework-Trace&#39;).style.display=&#39;none&#39;;document.getElementById(&#39;Full-Trace&#39;).style.display=&#39;block&#39;;; return false;&quot;&#62;Full Trace&#60;/a&#62; </div><div class="code_line">&nbsp;&nbsp;</div><div class="code_line">&nbsp;&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;&#60;div id=&quot;Application-Trace&quot; style=&quot;display: block;&quot;&#62;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;&#60;pre&#62;&#60;code&#62;/usr/lib/ruby/1.8/action_controller/routing/recognition_optimisation.rb:64:in `recognize_path&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/routing/route_set.rb:441:in `recognize&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/routing/route_set.rb:436:in `call&#39;&#60;/code&#62;&#60;/pre&#62;</div><div class="code_line">&nbsp;&nbsp; &nbsp;&#60;/div&#62;</div><div class="code_line">&nbsp;&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;&#60;div id=&quot;Framework-Trace&quot; style=&quot;display: none;&quot;&#62;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;&#60;pre&#62;&#60;code&#62;/usr/lib/ruby/1.8/action_controller/routing/recognition_optimisation.rb:64:in `recognize_path&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/routing/route_set.rb:441:in `recognize&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/routing/route_set.rb:436:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/dispatcher.rb:87:in `dispatch&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/dispatcher.rb:121:in `_call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/dispatcher.rb:130:in `build_middleware_stack&#39;</div><div class="code_line">/usr/lib/ruby/1.8/active_record/query_cache.rb:29:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/active_record/query_cache.rb:29:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache&#39;</div><div class="code_line">/usr/lib/ruby/1.8/active_record/query_cache.rb:9:in `cache&#39;</div><div class="code_line">/usr/lib/ruby/1.8/active_record/query_cache.rb:28:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/string_coercion.rb:25:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rack/head.rb:9:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rack/methodoverride.rb:24:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/params_parser.rb:15:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/session/cookie_store.rb:93:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/failsafe.rb:26:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rack/lock.rb:11:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rack/lock.rb:11:in `synchronize&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rack/lock.rb:11:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/dispatcher.rb:114:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/reloader.rb:34:in `run&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/dispatcher.rb:108:in `call&#39;</div><div class="code_line">/home/gafas/ruby-prj/test/vendor/rails/railties/lib/rails/rack/static.rb:31:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rack/urlmap.rb:47:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rack/urlmap.rb:41:in `each&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rack/urlmap.rb:41:in `call&#39;</div><div class="code_line">/home/gafas/ruby-prj/test/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rack/content_length.rb:13:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rack/chunked.rb:15:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rack/handler/mongrel.rb:67:in `process&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rack/handler/mongrel.rb:38:in `run&#39;</div><div class="code_line">/home/gafas/ruby-prj/test/vendor/rails/railties/lib/commands/server.rb:111</div><div class="code_line">/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require&#39;</div><div class="code_line">script/server:3&#60;/code&#62;&#60;/pre&#62;</div><div class="code_line">&nbsp;&nbsp; &nbsp;&#60;/div&#62;</div><div class="code_line">&nbsp;&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;&#60;div id=&quot;Full-Trace&quot; style=&quot;display: none;&quot;&#62;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;&#60;pre&#62;&#60;code&#62;/usr/lib/ruby/1.8/action_controller/routing/recognition_optimisation.rb:64:in `recognize_path&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/routing/route_set.rb:441:in `recognize&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/routing/route_set.rb:436:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/dispatcher.rb:87:in `dispatch&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/dispatcher.rb:121:in `_call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/dispatcher.rb:130:in `build_middleware_stack&#39;</div><div class="code_line">/usr/lib/ruby/1.8/active_record/query_cache.rb:29:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/active_record/query_cache.rb:29:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache&#39;</div><div class="code_line">/usr/lib/ruby/1.8/active_record/query_cache.rb:9:in `cache&#39;</div><div class="code_line">/usr/lib/ruby/1.8/active_record/query_cache.rb:28:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/string_coercion.rb:25:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rack/head.rb:9:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rack/methodoverride.rb:24:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/params_parser.rb:15:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/session/cookie_store.rb:93:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/failsafe.rb:26:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rack/lock.rb:11:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rack/lock.rb:11:in `synchronize&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rack/lock.rb:11:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/dispatcher.rb:114:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/reloader.rb:34:in `run&#39;</div><div class="code_line">/usr/lib/ruby/1.8/action_controller/dispatcher.rb:108:in `call&#39;</div><div class="code_line">/home/gafas/ruby-prj/test/vendor/rails/railties/lib/rails/rack/static.rb:31:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rack/urlmap.rb:47:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rack/urlmap.rb:41:in `each&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rack/urlmap.rb:41:in `call&#39;</div><div class="code_line">/home/gafas/ruby-prj/test/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rack/content_length.rb:13:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rack/chunked.rb:15:in `call&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rack/handler/mongrel.rb:67:in `process&#39;</div><div class="code_line">/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client&#39;</div><div class="code_line">/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each&#39;</div><div class="code_line">/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client&#39;</div><div class="code_line">/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run&#39;</div><div class="code_line">/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize&#39;</div><div class="code_line">/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new&#39;</div><div class="code_line">/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run&#39;</div><div class="code_line">/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize&#39;</div><div class="code_line">/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new&#39;</div><div class="code_line">/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rack/handler/mongrel.rb:38:in `run&#39;</div><div class="code_line">/home/gafas/ruby-prj/test/vendor/rails/railties/lib/commands/server.rb:111</div><div class="code_line">/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require&#39;</div><div class="code_line">/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require&#39;</div><div class="code_line">script/server:3&#60;/code&#62;&#60;/pre&#62;</div><div class="code_line">&nbsp;&nbsp; &nbsp;&#60;/div&#62;</div><div class="code_line">&nbsp;&nbsp;</div><div class="code_line">&#60;/div&#62;</div><div class="code_line">&#60;h2 style=&quot;margin-top: 30px&quot;&#62;Request&#60;/h2&#62;</div><div class="code_line">&#60;p&#62;&#60;b&#62;Parameters&#60;/b&#62;: &#60;pre&#62;{&quot;mail&quot;=&gt;&quot;username@mail.ru&quot;,</div><div class="code_line">&nbsp;&quot;login&quot;=&gt;&quot;username&quot;,</div><div class="code_line">&nbsp;&quot;password&quot;=&gt;&quot;124sf12ts&quot;}&#60;/pre&#62;&#60;/p&#62;</div><div class="code_line">&#60;p&#62;&#60;a href=&quot;#&quot; onclick=&quot;document.getElementById(&#39;session_dump&#39;).style.display=&#39;block&#39;; return false;&quot;&#62;Show session dump&#60;/a&#62;&#60;/p&#62;</div><div class="code_line">&#60;div id=&quot;session_dump&quot; style=&quot;display:none&quot;&#62;&#60;pre class=&#39;debug_dump&#39;&#62;--- </div><div class="code_line">&#60;/pre&#62;&#60;/div&#62;</div><div class="code_line">&#60;h2 style=&quot;margin-top: 30px&quot;&#62;Response&#60;/h2&#62;</div><div class="code_line">&#60;p&#62;&#60;b&#62;Headers&#60;/b&#62;: &#60;pre&#62;{&quot;Content-Type&quot;=&gt;&quot;&quot;,</div><div class="code_line">&nbsp;&quot;Allow&quot;=&gt;&quot;GET,</div><div class="code_line">&nbsp;PUT,</div><div class="code_line">&nbsp;DELETE&quot;,</div><div class="code_line">&nbsp;&quot;Cache-Control&quot;=&gt;&quot;no-cache&quot;}&#60;/pre&#62;&#60;/p&#62;</div><div class="code_line">&#60;/body&#62;</div><div class="code_line">&#60;/html&#62;</div></ol></div></div></div></div><br>
<br>
Пользователь при этом не создается &#33;&#33;&#33;]]></description>
        <author>Megathrone</author>
        <category>Ruby</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2909718</guid>
        <pubDate>Tue, 07 Jun 2011 12:03:24 +0000</pubDate>
        <title>RoR - возврат в XML формате &amp;#33;?</title>
        <link>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2909718</link>
        <description><![CDATA[XandoX: может ?<br>host = &quot;http://localhost:3000/users/post.xml&quot;]]></description>
        <author>XandoX</author>
        <category>Ruby</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2909299</guid>
        <pubDate>Tue, 07 Jun 2011 05:52:59 +0000</pubDate>
        <title>RoR - возврат в XML формате &amp;#33;?</title>
        <link>https://forum.sources.ru/index.php?showtopic=333212&amp;view=findpost&amp;p=2909299</link>
        <description><![CDATA[Megathrone: Всем привет &#33; <br>
Прошу помочь в таком вопросе :<br>
Есть простой клиент<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">#!/usr/bin/ruby</div><div class="code_line">require &#39;rubygems&#39;</div><div class="code_line">require &#39;httpclient&#39;</div><div class="code_line">require &#39;builder&#39;</div><div class="code_line">require &#39;active_support&#39;</div><div class="code_line">def smp_request(http_method, url, options = {}) </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return nil if url.nil? || url.size == 0</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;#options[&quot;tokenid&quot;] = &quot;#{ROBOT_CLIENT_TOKEN}&quot;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;p options if options.size &#62; 0</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;clnt = HTTPClient.new</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;http_method = &quot;get&quot; unless [&quot;get&quot;, &quot;post&quot;].include?(http_method)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;puts &quot;url is:#{url}&quot;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;begin</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case http_method</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;when &quot;get&quot;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; puts &quot;Request get ...&quot;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; request = clnt.get(url, options)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; puts &quot;Request get ... executed&quot; &nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;request.body </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;when &quot;post&quot;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; puts &quot;Request post ...&quot; &nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; request = clnt.post(url, options)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; puts &quot;Request post ... executed&quot; </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;request.body &nbsp; &nbsp; &nbsp; &nbsp; </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rescue</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; puts &quot;There is error&quot;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return nil</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; puts &quot;Request status = #{request.status}&quot;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return request</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end </div><div class="code_line">end</div><div class="code_line">puts &quot;Input Name :&quot;</div><div class="code_line">name = gets.chomp</div><div class="code_line">puts &quot;Input Mail :&quot;</div><div class="code_line">mail = gets.chomp</div><div class="code_line">puts &quot;Input Pass :&quot;</div><div class="code_line">pass = gets.chomp</div><div class="code_line">host = &quot;http://localhost:3000/users/post&quot;</div><div class="code_line">method = &quot;post&quot;</div><div class="code_line">data = {:login =&#62; name, :mail =&#62; mail, :password =&#62; pass}</div><div class="code_line">resp = smp_request(method, host, data)</div><div class="code_line">puts resp.body</div></ol></div></div></div></div><br>
<br>
отсылающий на сервер некие данные пользователя, код метода обработки простой <br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">def post</div><div class="code_line">&nbsp;&nbsp; &nbsp;@user = User.new(:login =&#62; params[:login], :email =&#62; params[:mail], :password =&#62; params[:password])</div><div class="code_line">&nbsp;&nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;respond_to do |accepts|</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if @user.save</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;accepts.html</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;accepts.xml { render :xml =&#62; @user.to_xml(:except =&#62; [:created_at, :updated_at]) }</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;else</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;format.html { render :action =&#62; &quot;new&quot; }</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;format.xml &nbsp;{ render :xml =&#62; @user.errors, :status =&#62; :unprocessable_entity }</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end &nbsp; &nbsp; &nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;end</div><div class="code_line">end</div></ol></div></div></div></div><br>
<br>
<br>
Юзер на стороне сервера создается и в соответствующем отображение в браузере это видно  &#33;&#33;&#33;<br>
Хотелось бы что бы в ответ от сервера приходил XML файл с данными только что созданного юзера, но приходит HTML код....  <br>
<br>
Помогите разобрать &#33; Спасибо &#33;]]></description>
        <author>Megathrone</author>
        <category>Ruby</category>
      </item>
	
      </channel>
      </rss>
	