<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: rails code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Thu, 28 Aug 2008 16:53:54 GMT</pubDate>
    <description>DZone Snippets: rails code</description>
    <item>
      <title>rake task for restart rails application runed on mod_rails</title>
      <link>http://snippets.dzone.com/posts/show/5543</link>
      <description>&lt;br /&gt;&lt;code&gt;&lt;br /&gt;amespace :passenger do&lt;br /&gt;  desc "Restart Application"&lt;br /&gt;  task :restart do&lt;br /&gt;    puts `touch tmp/restart.txt`&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 27 May 2008 12:26:32 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5543</guid>
      <author>bublik (Voloshin Ruslan)</author>
    </item>
    <item>
      <title>create new rails rake task</title>
      <link>http://snippets.dzone.com/posts/show/5185</link>
      <description>Create new task for /unit/helpers/*_test.rb&lt;br /&gt;&lt;br /&gt;Rakefile &lt;br /&gt;&lt;code&gt;&lt;br /&gt;namespace :test do&lt;br /&gt;  Rake::TestTask.new(:helpers) do |t|&lt;br /&gt;    t.libs &lt;&lt; "test"&lt;br /&gt;    t.pattern = 'test/unit/helper/*_test.rb'&lt;br /&gt;    t.verbose = true&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  Rake::Task['test:helpers'].invoke&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 28 Feb 2008 15:02:33 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5185</guid>
      <author>bublik (Voloshin Ruslan)</author>
    </item>
    <item>
      <title>Customize error_messages_for</title>
      <link>http://snippets.dzone.com/posts/show/4710</link>
      <description>// description of your code here&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt; module ActionView::Helpers::ActiveRecordHelper&lt;br /&gt;   def error_messages_for(object_name, options = {})&lt;br /&gt;    options = options.symbolize_keys&lt;br /&gt;    object = instance_variable_get("@#{object_name}")&lt;br /&gt;    if object &amp;&amp; !object.errors.empty?&lt;br /&gt;      content_tag("div",&lt;br /&gt;      content_tag(&lt;br /&gt;      options[:header_tag] || "h2",&lt;br /&gt;      "&#1042;&#1086;&#1079;&#1085;&#1080;&#1082;&#1083;&#1086; #{object.errors.count} &#1086;&#1096;&#1080;&#1073;&#1086;&#1082; &#1087;&#1088;&#1080; &#1089;&#1086;&#1093;&#1088;&#1072;&#1085;&#1077;&#1085;&#1080;&#1080;"&lt;br /&gt;      ) +&lt;br /&gt;      content_tag("p", "&#1055;&#1088;&#1086;&#1073;&#1083;&#1077;&#1084;&#1084;&#1099; &#1074;&#1086;&#1079;&#1085;&#1080;&#1082;&#1083;&#1080; &#1076;&#1083;&#1103; &#1089;&#1083;&#1077;&#1076;&#1091;&#1102;&#1097;&#1080;&#1093; &#1087;&#1086;&#1083;&#1077;&#1081;:") +&lt;br /&gt;      content_tag("dl", object.errors.full_messages.collect { |msg| content_tag("dt", msg) }),&lt;br /&gt;      "id" =&gt; options[:id] || "errorExplanation", "class" =&gt; options[:class] || "errorExplanation"&lt;br /&gt;      )&lt;br /&gt;    else&lt;br /&gt;      ""&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt; end&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Mon, 29 Oct 2007 08:45:56 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4710</guid>
      <author>bublik (Voloshin Ruslan)</author>
    </item>
    <item>
      <title>Pinging site </title>
      <link>http://snippets.dzone.com/posts/show/4213</link>
      <description>&#1042;&#1086;&#1090; &#1087;&#1088;&#1086;&#1089;&#1090;&#1086;&#1081; &#1087;&#1088;&#1080;&#1084;&#1077;&#1088; &#1082;&#1072;&#1082; &#1087;&#1088;&#1086;&#1087;&#1080;&#1085;&#1075;&#1086;&#1074;&#1099;&#1074;&#1072;&#1090;&#1100; &#1089;&#1072;&#1081;&#1090;&#1099; &#1087;&#1088;&#1080; &#1085;&#1086;&#1074;&#1099;&#1093; &#1087;&#1086;&#1089;&#1090;&#1072;&#1093; &#1073;&#1077;&#1079; &#1074;&#1082;&#1083;&#1102;&#1095;&#1077;&#1085;&#1080;&#1103; &#1076;&#1086;&#1087;&#1086;&#1087;&#1083;&#1085;&#1080;&#1090;&#1077;&#1083;&#1100;&#1085;&#1099;&#1093; &#1087;&#1083;&#1072;&#1075;&#1080;&#1085;&#1086;&#1074; &#1080; &#1084;&#1086;&#1076;&#1091;&#1083;&#1077;&#1081;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;irb(main):032:0&gt;&lt;br /&gt;irb(main):033:0* server = XMLRPC::Client.new("blogsearch.google.com", "/ping/RPC2", 80)&lt;br /&gt;=&gt; #&lt;XMLRPC::Client:0x2aaaaeb222e8 @create=nil, @port=80, @http=#&lt;Net::HTTP blogsearch.google.com:80 open=false&gt;, @proxy_host=nil, @http_last_response=nil, @parser=nil, @timeout=30, @path="/ping/RPC2", @password=nil, @http_header_extra=nil, @use_ssl=false, @host="blogsearch.google.com", @user=nil, @proxy_port=nil, @auth=nil, @cookie=nil&gt;&lt;br /&gt;irb(main):034:0&gt; server.call("weblogUpdates.extendedPing", 'Rubyclub.com.ua new on site','http://rubyclub.com.ua/', 'http://rubyclub.com.ua/messages/rss')&lt;br /&gt;=&gt; {"message"=&gt;"Thanks for the ping.", "flerror"=&gt;false}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 26 Jun 2007 14:17:40 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4213</guid>
      <author>bublik (Voloshin Ruslan)</author>
    </item>
  </channel>
</rss>
