<?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/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>show_for « Plataformatec Blog</title>
	<atom:link href="/tag/show_for/feed/" rel="self" type="application/rss+xml" />
	<link>/</link>
	<description>Plataformatec&#039;s place to talk about Ruby, Ruby on Rails, Elixir, and software engineering</description>
	<lastBuildDate>Fri, 10 May 2013 20:36:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.2</generator>
	<item>
		<title>Devise and Rails 4</title>
		<link>/2013/05/devise-and-rails-4/</link>
					<comments>/2013/05/devise-and-rails-4/#comments</comments>
		
		<dc:creator><![CDATA[Carlos Antônio]]></dc:creator>
		<pubDate>Fri, 10 May 2013 20:36:15 +0000</pubDate>
				<category><![CDATA[English]]></category>
		<category><![CDATA[devise]]></category>
		<category><![CDATA[mail_form]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[rails 4]]></category>
		<category><![CDATA[responders]]></category>
		<category><![CDATA[show_for]]></category>
		<category><![CDATA[simple_form]]></category>
		<guid isPermaLink="false">/?p=3440</guid>

					<description><![CDATA[<p>Devise 3.0 rc version with Rails 4 compatibility and new 2.2.4 stable version. Simple Form, Responders, Show For and Mail Form versions with Rails 4 compatibility.</p>
<p>The post <a href="/2013/05/devise-and-rails-4/">Devise and Rails 4</a> first appeared on <a href="/">Plataformatec Blog</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>This week we released the first release candidate version of Devise that is fully compatible with Rails 4, and we&#8217;re bumping its version to 3.0. This version completely drops support for Rails 3.1 and Ruby 1.8.7, only keeping compatibility with both Rails 3.2 and Rails 4, running with Ruby 1.9.3 and 2.0.</p>
<p>This rc version took some time to get ready, we&#8217;ve been running a <em>rails4</em> branch for some time already and one of the reasons was because of the changes required to <a href="https://github.com/plataformatec/devise/commit/c63483ae2409ba44889756796930f5d45630d7b3">make it compatible with the new <strong>strong parameters</strong> API from Rails 4</a>. We are aware that some people have been using this branch since Rails 4.0 beta1 with success, and we&#8217;re now inviting you to try 3.0 rc with the <a href="http://weblog.rubyonrails.org/2013/5/1/Rails-4-0-release-candidate-1/">recent release of Rails 4.0 rc1</a>.</p>
<h3>Devise stable</h3>
<p>Together with the 3.0 beta version, we&#8217;ve released Devise 2.2.4 with a few enhancements and bug fixes, make sure to <a href="https://github.com/plataformatec/devise/blob/v2.2.4/CHANGELOG.rdoc">check the changelog</a> to see the new goodies. All changes are also included in the rc version.</p>
<h3>Simple Form</h3>
<p>Simple Form has been running a 3.0 rc version for a couple months already, fully compatible with Rails 4 as well, and today we are releasing its release candidate version. In Simple Form master we just dropped support to the 3.x Rails series, focusing our work on Rails 4 compatibility from now on, due to a series of improvements in Rails 4 regarding form helpers &#8211; but don&#8217;t worry, we will be keeping a v2.1 branch with Rails 3.2 compatibility for a while.</p>
<p>We have some cool plans to improve the wrappers API even further, but that&#8217;s subject for another blog post :).</p>
<h3>Responders</h3>
<p>Responders has been around for quite some time already and we use it in most of our projects, so today we&#8217;re celebrating its 1.0 release candidate version, specially to support Rails 4.</p>
<h3>Show For</h3>
<p>Show For just got a new stable release, v0.2.6, with all the enhancements and bug fixes that were in master, plus a v0.3.0 rc version that adds Rails 4 support.</p>
<h3>Mail Form</h3>
<p>Mail Form also got a new 1.5 rc release with Rails 4.0 compatibility. Nothing else has changed from the current 1.4 version.</p>
<h3>Has Scope</h3>
<p>Has Scope is getting a new 0.6 rc version with Rails 4.0 compatibility, including a couple of fixes that were already present in master.</p>
<h2>Compatibility</h2>
<p>All these new releases are officially dropping support to Rails 3.0 and 3.1, and Ruby 1.8.7. We&#8217;ll keep compatibility with Rails 3.2 and 4.0 from now on, all of them on the same branches except for Simple Form which has different branches for each Rails version.</p>
<h2>Wrapping up</h2>
<p>We&#8217;ve got new hot releases for you to try out with Rails 4, please give them a try and let us know if you find any issue or have any feedback.</p>
<p>We&#8217;d also like to specially thank everyone involved in helping us getting these projects up and running in Rails 4, without you folks that&#8217;d have never been possible.</p>
<p>Enjoy &lt;3</p><p>The post <a href="/2013/05/devise-and-rails-4/">Devise and Rails 4</a> first appeared on <a href="/">Plataformatec Blog</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>/2013/05/devise-and-rails-4/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>2010 &#8211; A year in review</title>
		<link>/2010/12/2010-a-year-in-review/</link>
					<comments>/2010/12/2010-a-year-in-review/#comments</comments>
		
		<dc:creator><![CDATA[Vinicius Baggio]]></dc:creator>
		<pubDate>Thu, 30 Dec 2010 17:18:12 +0000</pubDate>
				<category><![CDATA[English]]></category>
		<category><![CDATA[devise]]></category>
		<category><![CDATA[dsl]]></category>
		<category><![CDATA[euruko]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[railsconf]]></category>
		<category><![CDATA[responders]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[rubyconf]]></category>
		<category><![CDATA[show_for]]></category>
		<category><![CDATA[simple_form]]></category>
		<guid isPermaLink="false">/?p=1612</guid>

					<description><![CDATA[<p>This year is coming to an end and it was amazing for us at Plataforma Tecnologia. We are proud to share with you, faithful reader, our accomplishments in 2010, which weren&#8217;t few. Open Source The year has begun on fire. In February, José Valim made his way into the Rails Core team and has been ... <a class="read-more-link" href="/2010/12/2010-a-year-in-review/">»</a></p>
<p>The post <a href="/2010/12/2010-a-year-in-review/">2010 – A year in review</a> first appeared on <a href="/">Plataformatec Blog</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>This year is coming to an end and it was amazing for us at Plataforma Tecnologia. We are proud to share with you, faithful reader, our accomplishments in 2010, which weren&#8217;t few.</p>
<h3>Open Source</h3>
<p>The year has begun on fire. In February, <a href="http://weblog.rubyonrails.org/2010/2/13/jos-e-valim-and-carl-lerche-joins-rails-core">José Valim made his way into the Rails Core team</a> and has been doing a great work since then, including many contributions to the Rails 3 release.</p>
<p>We are also really proud with <a href="http://www.github.com/plataformatec/devise">Devise</a>. It got very mature, achieving the 1.0 version this February. Since then, Devise is becoming one of the best solutions for authentication in Rails and also one of the most watched repositories on GitHub. </p>
<p>In August, <a href="/2010/08/devise-1-1-is-out-and-ready-to-rock-with-rails-3/">Devise 1.1</a> was released with Rails 3 support and a bunch of cool features. Recently, a lot of work is being done towards the 1.2 version, which includes full support to the awesome <a href="http://www.github.com/intridea/omniauth">OmniAuth</a> gem.</p>
<p>We also released <a href="http://www.github.com/plataformatec/simple_form">SimpleForm</a> this year. SimpleForm is our take on building forms in a simplified way lead by Carlos Antônio who recently did a great work on HTML 5 support.</p>
<p>Other gems were released, such as <a href="/2010/03/show-your-objects-baby/">ShowFor</a>, which is a DSL to simplify how you show your objects in views and also <a href="https://github.com/plataformatec/responders">Responders</a>, a collection of Rails 3 responders.</p>
<h3>Book</h3>
<p>Eariler this month, José Valim&#8217;s book entitled <a href="http://plataformatec.com.br/crafting-rails-applications/">Crafting Rails Applications</a> has been released by the highly acclaimed publisher <a href="http://www.pragprog.com/">Pragmatic Bookstore</a>! The book covers internal aspects of Rails 3 and how you can bend it to your will. The reviews and buzz has been great so far, even though still in beta. <a href="http://plataformatec.com.br/crafting-rails-applications/">Grab your copy now!</a></p>
<h3>Events</h3>
<p>This year was also very productive in terms of events. We&#8217;ve been to a lot of events, heck, George was even able to go to RailsConf, in Baltimore! Also, José Valim has spoken in various events, including <a href="/2010/06/dsl-or-nodsl-at-euruko-2010/">Euruko 2010 (includes video)</a>, <a href="http://vimeo.com/17088248">RubyConf Brazil 2010 (talk in portuguese)</a> and OxenteRails 2010. </p>
<p>Carlos, Hugo and George did their share as well, speaking at various events, from smaller and user-group events to bigger ones such as OxenteRails, RS on Rails and QCon SP.</p>
<h3>Company</h3>
<p>The company itself is getting more mature and increasing. At January 2010, PlataformaTec was composed of 6 people, and up until December 2010, 5 other people joined the company (including myself)! We also have started playing with iOS development, something we believe to have a great future, expect future blog posts on the subject.</p>
<h3>Great 2011!</h3>
<p>Have a great New Year! We wish you all the best for year to come. We have high expectations for 2011, so stay tuned!</p><p>The post <a href="/2010/12/2010-a-year-in-review/">2010 – A year in review</a> first appeared on <a href="/">Plataformatec Blog</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>/2010/12/2010-a-year-in-review/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Show your objects baby!</title>
		<link>/2010/03/show-your-objects-baby/</link>
					<comments>/2010/03/show-your-objects-baby/#comments</comments>
		
		<dc:creator><![CDATA[Carlos Antônio]]></dc:creator>
		<pubDate>Wed, 10 Mar 2010 19:03:05 +0000</pubDate>
				<category><![CDATA[English]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[show_for]]></category>
		<guid isPermaLink="false">/?p=817</guid>

					<description><![CDATA[<p>We have been having some projects lately that needed a lot of admin CRUDs and pages showing a list of attributes, and we were getting bored of copy and paste code like this in our show pages, for every single attribute: Name We had already created some helper to do the work for us, but ... <a class="read-more-link" href="/2010/03/show-your-objects-baby/">»</a></p>
<p>The post <a href="/2010/03/show-your-objects-baby/">Show your objects baby!</a> first appeared on <a href="/">Plataformatec Blog</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>We have been having some projects lately that needed a lot of admin CRUDs and pages showing a list of attributes, and we were getting bored of copy and paste code like this in our show pages, for every single attribute:</p>
<pre lang="ruby">
<p>
  <strong class="label">Name</strong><br />
  <%= @person.name %>
</p>
</pre>
<p>We had already created some helper to do the work for us, but having this helper being copied from one project to another wasn&#8217;t that DRY. That&#8217;s when we decided to create <a href="http://github.com/plataformatec/show_for" title="ShowFor - Wrap your objects with a helper to easily show them">ShowFor</a>.</p>
<p><a href="http://github.com/plataformatec/show_for" title="ShowFor - Wrap your objects with a helper to easily show them">ShowFor</a> is a DSL to help you showing a list of attributes, with I18n, perfect for show pages in CRUD interfaces. It allows you to replace code/html duplication in your views using a nice syntax. Let&#8217;s see what we can do.</p>
<h3>Attributes</h3>
<p>Let&#8217;s imagine we have a Person model, which has first_name, last_name, age, photo, and confirmed attributes. The following lines show a list of values for a specific person:</p>
<pre lang="ruby">
<% show_for @person do |p| %>
  <%= p.attribute :first_name %>
  <%= p.attribute :last_name %>
  <%= p.attribute :confirmed? %>
  <%= p.attribute :created_at, :format => :short %>
  <%= p.attribute :age, :if_blank => "No age" %>

  <% p.attribute :photo do %>
    <%= image_tag(@person.photo_url) %>
  <% end %>
<% end %>
</pre>
<p>Here is an example output you will get:</p>
<pre lang="html">
<div class="show_for person" id="person_1">
  <p class="wrapper person_first_name"><strong class="label">First name</strong><br />Carlos</p>
  <p class="wrapper person_last_name"><strong class="label">Last name</strong><br />Antonio</p>
  <p class="wrapper person_confirmed"><strong class="label">Confirmed?</strong><br />Yes</p>
  <p class="wrapper person_created_at"><strong class="label">Created at</strong><br />08 Mar 11:30</p>
  <p class="wrapper person_age"><strong class="label">Age</strong><br />24</p>
  <p class="wrapper person_photo"><strong class="label">Photo</strong><br />
    <img decoding="async" alt="Rails" src="/images/rails.png?1268047643" />
  </p>
</div>
</pre>
<p>As you can see, you are going to get a default html markup, with classes and ids to help you design with CSS. And if you noticed, we are using extra options in some attributes, lets take a look at some of them:</p>
<ul>
<li><code>:format</code> lets you pass any format that will be used together with i18n, for date/time attributes only, as you would use with the <code>l</code> helper.</li>
<li><code>:if_blank</code> specifies what to show if the attribute is blank. It may have a default value from i18n.</li>
<li><code>do...end</code>: using blocks you can handle the content for that specific attribute by yourself, as we have done in this example for the <code>photo</code> attribute.</li>
</ul>
<p>Boolean attributes, as our <code>:confirmed</code>, also have a default for <code>true</code> and <code>false</code> values, and can be configured through i18n. If you want to say &#8220;Yup&#8221; and &#8220;Nope&#8221; instead of &#8220;Yes&#8221; and &#8220;No&#8221; respectively, just change your i18n file. You can also pass a <code>:escape</code> option to not escape the value (<code>true</code> by default).</p>
<h3>Associations</h3>
<p><a href="http://github.com/plataformatec/show_for" title="ShowFor - Wrap your objects with a helper to easily show them">ShowFor</a> also works with associations. For instance, we can easily add that a Person belongs to a City with a name attribute and that it has and belongs to many Tags. To handle the former, we can do:</p>
<pre lang="ruby">
<%= p.association :city %>
</pre>
<p><a href="http://github.com/plataformatec/show_for" title="ShowFor - Wrap your objects with a helper to easily show them">ShowFor</a> will guess the right attribute to show by looking into all possibilities configured in <code>ShowFor.association_methods</code> and in this case choosing :name. But of course, you can change it as you need, on-the-fly:</p>
<pre lang="ruby">
<%= p.association :city, :using => :full_name %>
<%= p.attribute :full_name, :in => :city %>
</pre>
<p>Both calls above will have the same output, just choose the one which suits you better. </p>
<p>Handling collections is easy as belongs_to associations. You can just pass the association to <a href="http://github.com/plataformatec/show_for" title="ShowFor - Wrap your objects with a helper to easily show them">ShowFor</a> and it will know whether it&#8217;s a collection or not, generating a list of elements using <code>ul</code> and <code>li</code> tags.</p>
<pre lang="ruby">
<%= p.association :tags %>
</pre>
<p>However, if you want to render the collection inline, you can use :to_sentence or :join as options:</p>
<pre lang="ruby">
<%= p.association :tags, :to_sentence => true %>
<%= p.association :tags, :join => ',' %>
</pre>
<p>It&#8217;s also possible to pass a block to the collection. <a href="http://github.com/plataformatec/show_for" title="ShowFor - Wrap your objects with a helper to easily show them">ShowFor</a> will create the wrapper tag (<code>ul</code> by default in this case) and will <code>yield</code> each element in the collection for you to handle it:</p>
<pre lang="ruby">
<% a.association :tags do |tag| %>
  <li><%= link_to tag.name, tag %></li>
<% end %>
</pre>
<h3>Labels</h3>
<p>You may have noticed <a href="http://github.com/plataformatec/show_for" title="ShowFor - Wrap your objects with a helper to easily show them">ShowFor</a> has a default label using the <code>strong</code> html tag. It also exposes you this as a  helper, so you can use it whenever you wish:</p>
<pre lang="ruby">
  <%= p.label :first_name %>
  <%= p.label :age, :id => 'person_age' %>

  <strong class="label">First name</strong>
  <strong class="label" id="person_age">Age</strong>
</pre>
<h3>Installation</h3>
<p><a href="http://github.com/plataformatec/show_for" title="ShowFor - Wrap your objects with a helper to easily show them">ShowFor</a> is already compatible with Rails 3, at the time of this writing in version 0.2.0. You can just follow the instructions in the <a href="http://github.com/plataformatec/show_for/blob/master/README.rdoc">README</a> to get it installed.</p>
<p>If you are using Rails 2.3.x, take a look at the <a href="http://github.com/plataformatec/show_for/tree/v0.1">0.1 branch</a>, and follow the installations in the <a href="http://github.com/plataformatec/show_for/blob/v0.1/README.rdoc">README</a> for this branch to get it up and running.</p>
<p>Please don&#8217;t forget to run the generator and take a look at the initializer, it will allows you configure several parts of <a href="http://github.com/plataformatec/show_for" title="ShowFor - Wrap your objects with a helper to easily show them">ShowFor</a>.</p>
<pre lang="ruby">
script/generate show_for_install
</pre>
<h3>Closing</h3>
<p><a href="http://github.com/plataformatec/show_for" title="ShowFor - Wrap your objects with a helper to easily show them">ShowFor</a> helps you to show your objects easily with a default html markup, and can be totally configured to suit your needs. It has been helping us in every project, and we hope it may help you too. If you have any doubt, please take a look at the <a href="http://github.com/plataformatec/show_for/blob/master/README.rdoc">README</a>, there are a lot of examples and documentation there.</p>
<p>And what about you? Do you have any helper you use every single day that might be transformed in a plugin/gem? Do not hesitate on doing this, we would be glad to see your work.</p>
<p>Enjoy!</p><p>The post <a href="/2010/03/show-your-objects-baby/">Show your objects baby!</a> first appeared on <a href="/">Plataformatec Blog</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>/2010/03/show-your-objects-baby/feed/</wfw:commentRss>
			<slash:comments>49</slash:comments>
		
		
			</item>
	</channel>
</rss>
