<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>rails-bestpractices.com</title>
    <link>http://rails-bestpractices.com</link>
    <description>Learn the best practices of rails app and share your rails best practices</description>
    <language>en-us</language>
    <item>
      <title>Use Time.zone.now instead of Time.now</title>
      <description>The ActiveSupport method Time.zone.now should be used in place of the Ruby method Time.now to pickup the local time zone.    &lt;a href="http://rails-bestpractices.com/posts/2014/10/22/use-time-zone-now-instead-of-time-now"&gt;see more&lt;/a&gt;&lt;div&gt;&lt;p&gt;&lt;b&gt;Related Posts&lt;/b&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://rails-bestpractices.com/posts/2012/09/17/never-use-date-today"&gt;Never use Date.today&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;
	&lt;p&gt;
		&lt;b&gt;Subscribe&lt;/b&gt; to &lt;a href="http://feeds.feedburner.com/rails-bestpractices-team-blog"&gt;our team blog&lt;/a&gt;, you will get more information about rails_best_practices gem.&lt;/p&gt;
&lt;/div&gt;
</description>
      <author>dankohn</author>
      <pubDate>2014-10-22 22:14:20 UTC</pubDate>
      <link>http://rails-bestpractices.com/posts/2014/10/22/use-time-zone-now-instead-of-time-now</link>
      <guid>http://rails-bestpractices.com/posts/2014/10/22/use-time-zone-now-instead-of-time-now</guid>
    </item>
    <item>
      <title>Don't modify the params hash</title>
      <description>The params hash contains all the data that was submitted from a request. If you modify it, later code won't have access to it. Instead, copy the params hash and modify the copy.    &lt;a href="http://rails-bestpractices.com/posts/2013/09/18/don-t-modify-the-params-hash"&gt;see more&lt;/a&gt;&lt;div&gt;&lt;p&gt;&lt;b&gt;Related Posts&lt;/b&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://rails-bestpractices.com/posts/2010/07/14/move-finder-to-named_scope"&gt;Move finder to named_scope&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://rails-bestpractices.com/posts/2010/07/19/use-model-association"&gt;Use model association&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://rails-bestpractices.com/posts/2010/07/20/use-scope-access"&gt;Use scope access&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://rails-bestpractices.com/posts/2010/07/21/add-model-virtual-attribute"&gt;Add model virtual attribute&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;
	&lt;p&gt;
		&lt;b&gt;Subscribe&lt;/b&gt; to &lt;a href="http://feeds.feedburner.com/rails-bestpractices-team-blog"&gt;our team blog&lt;/a&gt;, you will get more information about rails_best_practices gem.&lt;/p&gt;
&lt;/div&gt;
</description>
      <author>daviddavis</author>
      <pubDate>2013-09-18 13:09:27 UTC</pubDate>
      <link>http://rails-bestpractices.com/posts/2013/09/18/don-t-modify-the-params-hash</link>
      <guid>http://rails-bestpractices.com/posts/2013/09/18/don-t-modify-the-params-hash</guid>
    </item>
    <item>
      <title>default_scope is evil</title>
      <description>activerecord provides default_scope to set a default scope for all operations on the model, it looks convenient at first, but will lead to some unexpected behaviors, we should avoid using it.     &lt;a href="http://rails-bestpractices.com/posts/2013/06/15/default_scope-is-evil"&gt;see more&lt;/a&gt;&lt;div&gt;&lt;p&gt;&lt;b&gt;Related Posts&lt;/b&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://rails-bestpractices.com/posts/2010/07/14/move-finder-to-named_scope"&gt;Move finder to named_scope&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://rails-bestpractices.com/posts/2010/07/19/use-model-association"&gt;Use model association&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://rails-bestpractices.com/posts/2010/07/21/add-model-virtual-attribute"&gt;Add model virtual attribute&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://rails-bestpractices.com/posts/2010/07/21/use-model-callback"&gt;Use model callback&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;
	&lt;p&gt;
		&lt;b&gt;Subscribe&lt;/b&gt; to &lt;a href="http://feeds.feedburner.com/rails-bestpractices-team-blog"&gt;our team blog&lt;/a&gt;, you will get more information about rails_best_practices gem.&lt;/p&gt;
&lt;/div&gt;
</description>
      <author>flyerhzm</author>
      <pubDate>2013-06-15 16:32:56 UTC</pubDate>
      <link>http://rails-bestpractices.com/posts/2013/06/15/default_scope-is-evil</link>
      <guid>http://rails-bestpractices.com/posts/2013/06/15/default_scope-is-evil</guid>
    </item>
    <item>
      <title>Clever enums in rails</title>
      <description>After many years of rails developing I have finally found satisfying solution to implement enums in rails.    &lt;a href="http://rails-bestpractices.com/posts/2013/04/18/clever-enums-in-rails"&gt;see more&lt;/a&gt;&lt;div&gt;&lt;p&gt;&lt;b&gt;Related Posts&lt;/b&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://rails-bestpractices.com/posts/2011/08/19/restrict-auto-generated-routes"&gt;Restrict auto-generated routes.&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;
	&lt;p&gt;
		&lt;b&gt;Subscribe&lt;/b&gt; to &lt;a href="http://feeds.feedburner.com/rails-bestpractices-team-blog"&gt;our team blog&lt;/a&gt;, you will get more information about rails_best_practices gem.&lt;/p&gt;
&lt;/div&gt;
</description>
      <author>codequest</author>
      <pubDate>2013-04-18 16:33:13 UTC</pubDate>
      <link>http://rails-bestpractices.com/posts/2013/04/18/clever-enums-in-rails</link>
      <guid>http://rails-bestpractices.com/posts/2013/04/18/clever-enums-in-rails</guid>
    </item>
    <item>
      <title>monitor your backend services</title>
      <description>We always have multiple processes for rails websites, if any of them crashed, your website failed, so it would be better to monitor all of the processes and automatically restart crashed processes.    &lt;a href="http://rails-bestpractices.com/posts/2013/03/28/monitor-your-backend-services"&gt;see more&lt;/a&gt;&lt;div&gt;
	&lt;p&gt;
		&lt;b&gt;Subscribe&lt;/b&gt; to &lt;a href="http://feeds.feedburner.com/rails-bestpractices-team-blog"&gt;our team blog&lt;/a&gt;, you will get more information about rails_best_practices gem.&lt;/p&gt;
&lt;/div&gt;
</description>
      <author>flyerhzm</author>
      <pubDate>2013-03-28 10:23:07 UTC</pubDate>
      <link>http://rails-bestpractices.com/posts/2013/03/28/monitor-your-backend-services</link>
      <guid>http://rails-bestpractices.com/posts/2013/03/28/monitor-your-backend-services</guid>
    </item>
    <item>
      <title>Pay more attentions on security</title>
      <description>Recently we saw rails exposed some security issues, github was attacked, rubygems.org was crashed, they all remind us we must pay more attentions on our rails projects.    &lt;a href="http://rails-bestpractices.com/posts/2013/03/22/pay-more-attentions-on-security"&gt;see more&lt;/a&gt;&lt;div&gt;&lt;p&gt;&lt;b&gt;Related Posts&lt;/b&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://rails-bestpractices.com/posts/2012/03/06/protect-mass-assignment"&gt;Protect mass assignment&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://rails-bestpractices.com/posts/2013/03/08/increase-protection-with-rack-protection"&gt;Increase protection with rack-protection&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;
	&lt;p&gt;
		&lt;b&gt;Subscribe&lt;/b&gt; to &lt;a href="http://feeds.feedburner.com/rails-bestpractices-team-blog"&gt;our team blog&lt;/a&gt;, you will get more information about rails_best_practices gem.&lt;/p&gt;
&lt;/div&gt;
</description>
      <author>flyerhzm</author>
      <pubDate>2013-03-22 00:40:42 UTC</pubDate>
      <link>http://rails-bestpractices.com/posts/2013/03/22/pay-more-attentions-on-security</link>
      <guid>http://rails-bestpractices.com/posts/2013/03/22/pay-more-attentions-on-security</guid>
    </item>
    <item>
      <title>speed up assets precompile with turbo-sprockets-rails3</title>
      <description>Rails is integrated with sprockets from 3.1, which gives you the power to pre-process, compress and minify your assets. It's awesome, but it slows down deployment a lot.     &lt;a href="http://rails-bestpractices.com/posts/2012/11/23/speed-up-assets-precompile-with-turbo-sprockets-rails3"&gt;see more&lt;/a&gt;&lt;div&gt;&lt;p&gt;&lt;b&gt;Related Posts&lt;/b&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://rails-bestpractices.com/posts/2010/07/31/use-asset_host-for-production-server"&gt;Use asset_host for production server&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://rails-bestpractices.com/posts/2010/08/15/use-css-sprite-automatically"&gt;Use css sprite automatically&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://rails-bestpractices.com/posts/2010/08/30/put-scripts-at-the-bottom"&gt;Put scripts at the bottom&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://rails-bestpractices.com/posts/2010/09/02/dry-bundler-in-capistrano"&gt;DRY bundler in capistrano&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;
	&lt;p&gt;
		&lt;b&gt;Subscribe&lt;/b&gt; to &lt;a href="http://feeds.feedburner.com/rails-bestpractices-team-blog"&gt;our team blog&lt;/a&gt;, you will get more information about rails_best_practices gem.&lt;/p&gt;
&lt;/div&gt;
</description>
      <author>flyerhzm</author>
      <pubDate>2012-11-23 09:29:41 UTC</pubDate>
      <link>http://rails-bestpractices.com/posts/2012/11/23/speed-up-assets-precompile-with-turbo-sprockets-rails3</link>
      <guid>http://rails-bestpractices.com/posts/2012/11/23/speed-up-assets-precompile-with-turbo-sprockets-rails3</guid>
    </item>
    <item>
      <title>Check the return value of "save", otherwise use "save!"</title>
      <description>The "save" method on ActiveRecord returns "false" and does nothing if the record is invalid. You should always check the return value, otherwise you may inadvertently not save the record. If you think the record can never be invalid, or don't want to check the return value, use "save!"    &lt;a href="http://rails-bestpractices.com/posts/2012/11/02/check-the-return-value-of-save-otherwise-use-save"&gt;see more&lt;/a&gt;&lt;div&gt;
	&lt;p&gt;
		&lt;b&gt;Subscribe&lt;/b&gt; to &lt;a href="http://feeds.feedburner.com/rails-bestpractices-team-blog"&gt;our team blog&lt;/a&gt;, you will get more information about rails_best_practices gem.&lt;/p&gt;
&lt;/div&gt;
</description>
      <author>flyerhzm</author>
      <pubDate>2012-11-02 09:16:44 UTC</pubDate>
      <link>http://rails-bestpractices.com/posts/2012/11/02/check-the-return-value-of-save-otherwise-use-save</link>
      <guid>http://rails-bestpractices.com/posts/2012/11/02/check-the-return-value-of-save-otherwise-use-save</guid>
    </item>
    <item>
      <title>Don't rescue Exception, rescue StandardError</title>
      <description>In C# or Java, you can `catch (Exception)` to rescue all exception types. However, in Ruby you should almost never catch `Exception`, but only catch `StandardError`.

    &lt;a href="http://rails-bestpractices.com/posts/2012/11/01/don-t-rescue-exception-rescue-standarderror"&gt;see more&lt;/a&gt;&lt;div&gt;
	&lt;p&gt;
		&lt;b&gt;Subscribe&lt;/b&gt; to &lt;a href="http://feeds.feedburner.com/rails-bestpractices-team-blog"&gt;our team blog&lt;/a&gt;, you will get more information about rails_best_practices gem.&lt;/p&gt;
&lt;/div&gt;
</description>
      <author>ricbrad</author>
      <pubDate>2012-11-01 12:44:44 UTC</pubDate>
      <link>http://rails-bestpractices.com/posts/2012/11/01/don-t-rescue-exception-rescue-standarderror</link>
      <guid>http://rails-bestpractices.com/posts/2012/11/01/don-t-rescue-exception-rescue-standarderror</guid>
    </item>
    <item>
      <title>Tell, don't ask</title>
      <description>Methods should focus on what you want done and not how you want it.    &lt;a href="http://rails-bestpractices.com/posts/2012/09/29/tell-don-t-ask"&gt;see more&lt;/a&gt;&lt;div&gt;&lt;p&gt;&lt;b&gt;Related Posts&lt;/b&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://rails-bestpractices.com/posts/2010/07/14/move-finder-to-named_scope"&gt;Move finder to named_scope&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://rails-bestpractices.com/posts/2010/07/19/use-model-association"&gt;Use model association&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://rails-bestpractices.com/posts/2010/07/21/add-model-virtual-attribute"&gt;Add model virtual attribute&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://rails-bestpractices.com/posts/2010/07/21/use-model-callback"&gt;Use model callback&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;
	&lt;p&gt;
		&lt;b&gt;Subscribe&lt;/b&gt; to &lt;a href="http://feeds.feedburner.com/rails-bestpractices-team-blog"&gt;our team blog&lt;/a&gt;, you will get more information about rails_best_practices gem.&lt;/p&gt;
&lt;/div&gt;
</description>
      <author>zamith</author>
      <pubDate>2012-09-29 12:57:40 UTC</pubDate>
      <link>http://rails-bestpractices.com/posts/2012/09/29/tell-don-t-ask</link>
      <guid>http://rails-bestpractices.com/posts/2012/09/29/tell-don-t-ask</guid>
    </item>
  </channel>
</rss>
