<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Una juventud que no crea es una anomalía realmente.</description><title>No Pressure</title><generator>Tumblr (3.0; @nopressurecouk)</generator><link>http://nopressure.co.uk/</link><item><title>Mongoid recursively embedding</title><description>&lt;p&gt;This is a note for myself for a project I am actually working on that I thought could be useful to share :)&lt;/p&gt;
&lt;p&gt;More info &lt;a href="http://mongoid.org/docs/relations/embedded/1-n.html" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;CYCLIC RELATIONS on MONGODB WITH MONGOID&lt;/h3&gt;
&lt;p&gt;A document can recursively embed itself using recursively_embeds_many, which provides accessors for the parent and children.&lt;/p&gt;
&lt;div class="CodeRay"&gt;
&lt;div class="code"&gt;
&lt;pre&gt;&lt;span class="keyword"&gt;class&lt;/span&gt; &lt;span class="class"&gt;Tag&lt;/span&gt;
  include &lt;span class="constant"&gt;Mongoid&lt;/span&gt;::&lt;span class="constant"&gt;Document&lt;/span&gt;
  recursively_embeds_many
  field &lt;span class="symbol"&gt;:name&lt;/span&gt;
&lt;span class="keyword"&gt;end&lt;/span&gt;

programming = &lt;span class="constant"&gt;Tag&lt;/span&gt;.new(&lt;span class="symbol"&gt;:name&lt;/span&gt; =&amp;gt; &lt;span class="string"&gt;&lt;span class="delimiter"&gt;'&lt;/span&gt;&lt;span class="content"&gt;programming&lt;/span&gt;&lt;span class="delimiter"&gt;'&lt;/span&gt;&lt;/span&gt;)
ruby = programming.child_tags.build(&lt;span class="symbol"&gt;:name&lt;/span&gt; =&amp;gt; &lt;span class="string"&gt;&lt;span class="delimiter"&gt;'&lt;/span&gt;&lt;span class="content"&gt;ruby&lt;/span&gt;&lt;span class="delimiter"&gt;'&lt;/span&gt;&lt;/span&gt;)
python = programming.child_tags.build(&lt;span class="symbol"&gt;:name&lt;/span&gt; =&amp;gt; &lt;span class="string"&gt;&lt;span class="delimiter"&gt;'&lt;/span&gt;&lt;span class="content"&gt;python&lt;/span&gt;&lt;span class="delimiter"&gt;'&lt;/span&gt;&lt;/span&gt;)

programming.child_tags  &lt;span class="comment"&gt;# [ruby, python]&lt;/span&gt;
ruby.parent_tag         &lt;span class="comment"&gt;# [programming]&lt;/span&gt;
python.parent_tag       &lt;span class="comment"&gt;# [programming]&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;</description><link>http://nopressure.co.uk/post/23538156280</link><guid>http://nopressure.co.uk/post/23538156280</guid><pubDate>Tue, 22 May 2012 11:28:55 +0100</pubDate><category>Mongoid</category><category>Mongodb</category><category>Mongo</category><category>Rails</category><category>Ruby</category><category>Embeds</category><category>Embeds_many</category><category>Embedding</category></item><item><title>Updating embedded child objects when the parent object is saved.</title><description>&lt;p&gt;Mongoid has added a tag which automatically makes callbacks for embedded child objects when the parent object is saved.&lt;/p&gt;
&lt;p&gt;You can find it at the end of the mongoid documentation on &lt;a href="http://mongoid.org/docs/relations/embedded/1-n.html" target="_blank"&gt;embedding&lt;/a&gt;.&lt;/p&gt;

&lt;pre class="lang-rb prettyprint"&gt;&lt;code&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Post&lt;/span&gt;&lt;span class="pln"&gt;&lt;br/&gt;  include &lt;/span&gt;&lt;span class="typ"&gt;Mongoid&lt;/span&gt;&lt;span class="pun"&gt;::&lt;/span&gt;&lt;span class="typ"&gt;Document&lt;/span&gt;&lt;span class="pln"&gt;&lt;br/&gt;  include &lt;/span&gt;&lt;span class="typ"&gt;Mongoid&lt;/span&gt;&lt;span class="pun"&gt;::&lt;/span&gt;&lt;span class="typ"&gt;Timestamps&lt;/span&gt;&lt;span class="pln"&gt;&lt;br/&gt;  include &lt;/span&gt;&lt;span class="typ"&gt;Mongoid&lt;/span&gt;&lt;span class="pun"&gt;::&lt;/span&gt;&lt;span class="typ"&gt;Paranoia&lt;/span&gt;&lt;span class="pln"&gt;&lt;br/&gt;&lt;br/&gt;  embeds_many &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;comments&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; cascade_callbacks&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;true&lt;/span&gt;&lt;span class="pln"&gt;&lt;br/&gt;  accepts_nested_attributes_for &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;comments&lt;br/&gt;&lt;/span&gt;&lt;span class="kwd"&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;</description><link>http://nopressure.co.uk/post/23538103279</link><guid>http://nopressure.co.uk/post/23538103279</guid><pubDate>Tue, 22 May 2012 11:26:32 +0100</pubDate><category>rails</category><category>mongoid</category><category>ruby</category><category>mongodb</category></item><item><title>"I am truly free only when all human beings, men and women, are equally free. The freedom of other..."</title><description>“I am truly free only when all human beings, men and women, are equally free. The freedom of other men, far from negating or limiting my freedom, is, on the contrary, its necessary premise and confirmation. It is the slavery of other men that sets up a barrier to my freedom, or what amounts to the same thing, it is their bestiality which is the negation of my humanity. For my dignity as a man, my human right which consists of refusing to obey any other man, and to determine my own acts in conformity with my convictions is reflected by the equally free conscience of all and confirmed by the consent of all humanity. My personal freedom, confirmed by the liberty of all, extends to infinity.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;span&gt;Mikhail Bakunin - &lt;/span&gt;&lt;em&gt;Bakunin on Anarchy&lt;/em&gt;&lt;/em&gt;</description><link>http://nopressure.co.uk/post/23283006161</link><guid>http://nopressure.co.uk/post/23283006161</guid><pubDate>Fri, 18 May 2012 10:16:28 +0100</pubDate><category>Freedom</category></item><item><title>"Do I contradict myself? Very well, then I contradict myself, I am large, I contain multitudes."</title><description>“Do I contradict myself? Very well, then I contradict myself, I am large, I contain multitudes.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;Whitman&lt;/em&gt;</description><link>http://nopressure.co.uk/post/23229488026</link><guid>http://nopressure.co.uk/post/23229488026</guid><pubDate>Thu, 17 May 2012 15:40:00 +0100</pubDate><category>Contradction</category></item><item><title>"I find fascinating how people protect the right of the richest for fear of loosing what they..."</title><description>“I find fascinating how people protect the right of the richest for fear of loosing what they don’t have but are told they might get someday…”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;my self :)&lt;/em&gt;</description><link>http://nopressure.co.uk/post/23166239185</link><guid>http://nopressure.co.uk/post/23166239185</guid><pubDate>Wed, 16 May 2012 15:53:42 +0100</pubDate><category>occupy</category><category>15M12M</category><category>revolution</category><category>MACAO</category></item><item><title>"If you go where everybody else is you might just end up doing the same thing… if you think..."</title><description>“If you go where everybody else is you might just end up doing the same thing… if you think about it Bob Marley didn’t go to London or New York to play Rock music, he stayed in Jamaica to invent Reggae…”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;myself :)&lt;/em&gt;</description><link>http://nopressure.co.uk/post/23037192854</link><guid>http://nopressure.co.uk/post/23037192854</guid><pubDate>Mon, 14 May 2012 14:44:40 +0100</pubDate><category>Bob Marley</category><category>Music</category><category>Creativity</category></item><item><title>Nested hash in ruby</title><description>&lt;p&gt;Ever wondered how to create nested hash in ruby?&lt;/p&gt;
&lt;p&gt;Here it is:&lt;/p&gt;
&lt;p&gt;1.9.3p125 :001 &amp;gt; a = Hash.new{|h,k| h[k]=Hash.new(&amp;amp;h.default_proc) }&lt;/p&gt;
&lt;p&gt; =&amp;gt; {} &lt;/p&gt;
&lt;p&gt;1.9.3p125 :002 &amp;gt; a[2][1] = 2&lt;/p&gt;
&lt;p&gt; =&amp;gt; 2 &lt;/p&gt;
&lt;p&gt;1.9.3p125 :003 &amp;gt; a[2][2][3] = 2&lt;/p&gt;
&lt;p&gt; =&amp;gt; 2 &lt;/p&gt;
&lt;p&gt;1.9.3p125 :004 &amp;gt; a[2][2][4] = 5&lt;/p&gt;
&lt;p&gt; =&amp;gt; 5 &lt;/p&gt;
&lt;p&gt;1.9.3p125 :005 &amp;gt; a[3][1][1][1] = 7&lt;/p&gt;
&lt;p&gt; =&amp;gt; 7 &lt;/p&gt;
&lt;p&gt;1.9.3p125 :006 &amp;gt; a&lt;/p&gt;
&lt;p&gt; =&amp;gt; {2=&amp;gt;{1=&amp;gt;2, 2=&amp;gt;{3=&amp;gt;2, 4=&amp;gt;5}}, 3=&amp;gt;{1=&amp;gt;{1=&amp;gt;{1=&amp;gt;7}}}} &lt;/p&gt;
&lt;p&gt;:) sweet!&lt;/p&gt;</description><link>http://nopressure.co.uk/post/23037130340</link><guid>http://nopressure.co.uk/post/23037130340</guid><pubDate>Mon, 14 May 2012 14:42:24 +0100</pubDate><category>ruby</category><category>hash</category><category>nested hash</category><category>ruby on rails</category></item><item><title>Devise + Mongoid + Cancan</title><description>&lt;p&gt;I have thought a while about making a summary post about configuring &lt;a href="https://github.com/plataformatec/devise" target="_blank"&gt;devise&lt;/a&gt; + &lt;a href="http://mongoid.org/" target="_blank"&gt;mongoid&lt;/a&gt; + &lt;a href="https://github.com/ryanb/cancan" target="_blank"&gt;cancan&lt;/a&gt; for creating accounts and implementing authentication in a rails app.&lt;/p&gt;
&lt;p&gt;First of all there are various guides that you can use to get you started. All of them can give you a different insight on the technology and a different perspective and what is needed to accomplish whatever you have in mind :).&lt;/p&gt;
&lt;p&gt;So feel free to google for devise + cancan and you end up reading &lt;a href="http://www.tonyamoyal.com/2010/07/28/rails-authentication-with-devise-and-cancan-customizing-devise-controllers/" target="_blank"&gt;Tony Amoyal&amp;#8217;s blog post&lt;/a&gt;. It is a very good post description and pointed me toward the right direction.&lt;/p&gt;
&lt;p&gt;If you want a different point of view though (also considering that I am using mongoid), here is my dirty summary on how to configure an app that would use these gems:&lt;/p&gt;
&lt;p&gt;First of all install devise:&lt;/p&gt;
&lt;p&gt;Devise 2.0 works with Rails 3.1 onwards. You can add it to your Gemfile with: gem &amp;#8216;devise&amp;#8217; or run the bundle command.&lt;/p&gt;
&lt;p&gt;After devise has been installed, run the generator:&lt;/p&gt;

&lt;div class="highlight"&gt;
&lt;pre&gt;&lt;span class="go"&gt;rails generate devise:install&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span&gt;The generator installs an initializer describing All devise&amp;#8217;s configuration options and it is advised to have a look at it. Then add devise to your models using the generator:&lt;/span&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre&gt;&lt;span class="go"&gt;rails generate devise MODEL &lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span&gt;More details are available &lt;a href="https://github.com/plataformatec/devise" target="_blank"&gt;here&lt;/a&gt;: &lt;/span&gt;&lt;a href="https://github.com/plataformatec/devise" target="_blank"&gt;&lt;a href="https://github.com/plataformatec/devise" target="_blank"&gt;https://github.com/plataformatec/devise&lt;/a&gt;&lt;/a&gt;; together with links to some example app that could be extended to suit your needs.&lt;/p&gt;
&lt;p&gt;Now let&amp;#8217;s install cancan. In Rails 2 you can add it to your Gemfile and or run the bundle command:&lt;/p&gt;

&lt;pre&gt;gem "cancan"&lt;/pre&gt;


&lt;p&gt;&lt;span&gt;Continue with using the generator for creating the Ability class for a User:&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;rails g cancan:ability&lt;/pre&gt;

&lt;p&gt;Simple as that. You can find out more &lt;a href="https://github.com/ryanb/cancan" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Now how should you model your User and Admin accounts? You can do this with a single user class, or you can do it with different classes :).&lt;/p&gt;
&lt;p&gt;I personally prefer to use different classes to keep the two roles separately.&lt;/p&gt;</description><link>http://nopressure.co.uk/post/19953280803</link><guid>http://nopressure.co.uk/post/19953280803</guid><pubDate>Mon, 26 Mar 2012 15:19:49 +0100</pubDate><category>devise</category><category>mongoid</category><category>cancan</category><category>rails</category><category>app</category><category>authentication</category></item><item><title>Hai fatto parte del POuL un po' di tempo fa? :-)</title><description>&lt;p&gt;Si :)&lt;/p&gt;
&lt;p&gt;Anche tu? Ci conosciamo? Il mio nick era Hiromi.&lt;/p&gt;</description><link>http://nopressure.co.uk/post/19066529202</link><guid>http://nopressure.co.uk/post/19066529202</guid><pubDate>Sat, 10 Mar 2012 17:57:15 +0000</pubDate></item><item><title>How to load a feed with Google Feed API and JQuery</title><description>&lt;p&gt;Here is a quick and dirty way to load a xml feed with Google Feed API with Jquery. Enjoy!! :)&lt;/p&gt;
&lt;p&gt;First step include the necessary external calls:&lt;/p&gt;
&lt;p&gt;&amp;lt;script src=&amp;#8221;https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js&amp;#8221;&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;script type=&amp;#8221;text/javascript&amp;#8221; src=&amp;#8221;https://www.google.com/jsapi&amp;#8221;&amp;gt;&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt;Second step your javascript function:&lt;/p&gt;
&lt;p&gt;&amp;lt;script&amp;gt;&lt;/p&gt;
&lt;p&gt;    &lt;span&gt; &lt;/span&gt;/*&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;*  How to load a feed via the Feeds API.&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;*/&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;google.load(&amp;#8220;feeds&amp;#8221;, &amp;#8220;1&amp;#8221;);&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;// Our callback function, for when a feed is loaded.&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;function feedLoaded(result) {&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;  if (!result.error) {&lt;/p&gt;
&lt;p&gt;    &lt;span&gt; &lt;/span&gt;// Grab the container we will put the results into&lt;/p&gt;
&lt;p&gt;    &lt;span&gt; &lt;/span&gt;var container = $(&amp;#8220;#latest&amp;#8221;);&lt;/p&gt;
&lt;p&gt;    &lt;span&gt; &lt;/span&gt;$(&amp;#8220;#latest&amp;#8221;).empty();&lt;/p&gt;
&lt;p&gt;    &lt;span&gt; &lt;/span&gt;html = &amp;#8220;&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt;&amp;#8221;;&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;    // Loop through the feeds, putting the titles onto the page.&lt;/p&gt;
&lt;p&gt;    &lt;span&gt; &lt;/span&gt;// Check out the result object for a list of properties returned in each entry.&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;    // &lt;a href="http://code.google.com/apis/ajaxfeeds/documentation/reference.html#JSON" target="_blank"&gt;http://code.google.com/apis/ajaxfeeds/documentation/reference.html#JSON&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;    &lt;span&gt; &lt;/span&gt;for (var i = 0; i &amp;lt; result.feed.entries.length; i++) {&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;      var entry = result.feed.entries[i];&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;      html += &amp;#8220;&amp;lt;li&amp;gt;&amp;#8221; &lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;           + entry.title &lt;/p&gt;
&lt;p&gt;    &lt;span&gt; &lt;/span&gt;  &lt;span&gt; &lt;/span&gt;   + &amp;#8220;&amp;lt;/li&amp;gt;&amp;#8221;;&lt;/p&gt;
&lt;p&gt;    &lt;span&gt; &lt;/span&gt;}&lt;/p&gt;
&lt;p&gt;    &lt;span&gt; &lt;/span&gt;html += &amp;#8220;&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt; &amp;#8220;;&lt;/p&gt;
&lt;p&gt;    &lt;span&gt; &lt;/span&gt;$(&amp;#8220;#latest&amp;#8221;).append(html);&lt;/p&gt;
&lt;p&gt;  &lt;span&gt; &lt;/span&gt;}&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;}&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;function OnLoad() {&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;  // Create a feed instance that will grab Digg&amp;#8217;s feed.&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;  var feed = new google.feeds.Feed(&amp;#8220;https://gdata.youtube.com/feeds/api/users/devinsupertramp/uploads&amp;#8221;);&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;  // Calling load sends the request off.  It requires a callback function.&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;  feed.load(feedLoaded);&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;}&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;google.setOnLoadCallback(OnLoad);&lt;span&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt;Third and last step, add a div into your code to contain the results:&lt;/p&gt;
&lt;p&gt;&amp;lt;div id=&amp;#8221;latest&amp;#8221;&amp;gt;&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;Super quick!! Enjoy!!&lt;/p&gt;</description><link>http://nopressure.co.uk/post/18004511385</link><guid>http://nopressure.co.uk/post/18004511385</guid><pubDate>Tue, 21 Feb 2012 10:13:00 +0000</pubDate><category>Google Feed API</category><category>JQuery</category><category>Javascript</category><category>Feeds</category><category>XML</category><category>Atom</category><category>HTML</category></item><item><title>Quick and dirty search in Rails</title><description>&lt;p&gt;Ever wondered how to quick have a search function in your rails app?&lt;/p&gt;
&lt;p&gt;Here is a super quick and maybe a lil dirty way to achieve so.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;First step:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The view&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt; &lt;code&gt; &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt; &amp;lt;p&amp;gt;&amp;lt;%= form_tag("/searches", :method =&amp;gt; "get") do %&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;
&lt;p&gt;           &amp;lt;%= text_field_tag :keywords, params[:keywords] %&amp;gt; &amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;p&gt;       &amp;lt;p&amp;gt;  &amp;lt;%= submit_tag("Search") %&amp;gt;&lt;/p&gt;
&lt;p&gt;           &amp;lt;% end %&amp;gt;&lt;/p&gt;
&lt;p&gt;       &amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Second step:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;search.rb model (app/models)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;
&lt;p&gt;class Search &amp;lt; ActiveRecord::Base&lt;/p&gt;
&lt;p&gt;  def self.find_results(search)&lt;/p&gt;
&lt;p&gt;    if search&lt;/p&gt;
&lt;p&gt;      Item.find(:all, :conditions =&amp;gt; ['name LIKE ?', "%#{search}%"])&lt;/p&gt;
&lt;p&gt;    else&lt;/p&gt;
&lt;p&gt;      Item.find(:all)&lt;/p&gt;
&lt;p&gt;    end&lt;/p&gt;
&lt;p&gt;  end&lt;/p&gt;
&lt;p&gt;end&lt;/p&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Third step:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;searches_controller.rb (app/controllers)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;
&lt;p&gt;class SearchesController &amp;lt; ApplicationController&lt;/p&gt;
&lt;p&gt;  def index&lt;/p&gt;
&lt;p&gt;    @results = Search.find_results(params[:keywords])&lt;/p&gt;
&lt;p&gt;  end&lt;/p&gt;
&lt;p&gt;end&lt;/p&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Fourth step:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;index.html.erb (app/views/searches)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;
&lt;p&gt;&amp;lt;% @results.each do |result| %&amp;gt;&lt;/p&gt;
&lt;p&gt;             &amp;lt;p&amp;gt;&amp;lt;%= result.name %&amp;gt;&amp;lt;/p&amp;gt;&lt;/p&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Done :)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Just don&amp;#8217;t forget to add   resources :searches, :controllers =&amp;gt; &amp;#8216;searches&amp;#8217; to your routes.rb!&lt;/p&gt;</description><link>http://nopressure.co.uk/post/13550637932</link><guid>http://nopressure.co.uk/post/13550637932</guid><pubDate>Wed, 30 Nov 2011 17:32:08 +0000</pubDate><category>Ruby on Rails</category><category>Rails</category><category>Search</category><category>Search Form</category></item><item><title>Ruby headaches pills</title><description>&lt;p&gt;If:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;script/rails generate controller Hello&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Is failing, try to remember that you have probably installed more than one version of rails in your history, so you might need to call:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;rvm use 1.9.1 &amp;#8212;default :)&lt;/em&gt;&lt;/p&gt;</description><link>http://nopressure.co.uk/post/11572457829</link><guid>http://nopressure.co.uk/post/11572457829</guid><pubDate>Mon, 17 Oct 2011 16:33:09 +0100</pubDate><category>Ruby</category><category>Common Errors</category><category>Ruby mistakes</category><category>RVM</category></item><item><title>"The future is distributed!"</title><description>“The future is distributed!”</description><link>http://nopressure.co.uk/post/10238523865</link><guid>http://nopressure.co.uk/post/10238523865</guid><pubDate>Thu, 15 Sep 2011 14:23:33 +0100</pubDate><category>Future</category><category>Distributed Systems</category><category>System Integration</category></item><item><title>Hire the hackers!</title><description>&lt;object width="400" height="284"&gt;&lt;param name="movie" value="http://video.ted.com/assets/player/swf/EmbedPlayer.swf" /&gt;&lt;param name="allowFullScreen" value="true" /&gt;&lt;param name="allowScriptAccess" value="always" /&gt;&lt;param name="wmode" value="transparent" /&gt;&lt;param name="bgColor" value="#ffffff" /&gt;&lt;param name="flashvars" value="vu=http://video.ted.com/talk/stream/2011G/Blank/MishaGlenny_2011G-320k.mp4&amp;su=http://images.ted.com/images/ted/tedindex/embed-posters/MishaGlenny_2011G-embed.jpg&amp;vw=512&amp;vh=288&amp;ap=0&amp;ti=1221&amp;lang=eng&amp;introDuration=15330&amp;adDuration=4000&amp;postAdDuration=830&amp;adKeys=talk=misha_glenny_hire_the_hackers;year=2011;theme=technology_history_and_destiny;theme=bold_predictions_stern_warnings;theme=new_on_ted_com;theme=not_business_as_usual;theme=a_taste_of_tedglobal_2011;event=TEDGlobal+2011;tag=Global+Issues;tag=Technology;tag=computers;tag=crime;tag=internet;&amp;preAdTag=tconf.ted/embed;tile=1;sz=512x288;" /&gt;&lt;embed src="http://video.ted.com/assets/player/swf/EmbedPlayer.swf" pluginspace="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" bgcolor="#ffffff" width="400" height="284" allowfullscreen="true" allowscriptaccess="always" flashvars="vu=http://video.ted.com/talk/stream/2011G/Blank/MishaGlenny_2011G-320k.mp4&amp;su=http://images.ted.com/images/ted/tedindex/embed-posters/MishaGlenny_2011G-embed.jpg&amp;vw=512&amp;vh=288&amp;ap=0&amp;ti=1221&amp;lang=eng&amp;introDuration=15330&amp;adDuration=4000&amp;postAdDuration=830&amp;adKeys=talk=misha_glenny_hire_the_hackers;year=2011;theme=technology_history_and_destiny;theme=bold_predictions_stern_warnings;theme=new_on_ted_com;theme=not_business_as_usual;theme=a_taste_of_tedglobal_2011;event=TEDGlobal+2011;tag=Global+Issues;tag=Technology;tag=computers;tag=crime;tag=internet;&amp;preAdTag=tconf.ted/embed;tile=1;sz=512x288;"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Hire the hackers!&lt;/p&gt;</description><link>http://nopressure.co.uk/post/10197926721</link><guid>http://nopressure.co.uk/post/10197926721</guid><pubDate>Wed, 14 Sep 2011 10:53:00 +0100</pubDate><category>Anonymous</category><category>Hackers</category><category>Privacy</category><category>TED</category><category>Data Protection</category></item><item><title>ckck:

Control panel at IBM. San Jose, California, circa...</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_lr0u6cOLu51qz7o2mo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://ckck.tumblr.com/post/9880442141" target="_blank"&gt;ckck&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Control panel at IBM. San Jose, California, circa 1958.&lt;/p&gt;
&lt;p&gt;Photograph by Arnold Del Carlo.&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://nopressure.co.uk/post/9882110058</link><guid>http://nopressure.co.uk/post/9882110058</guid><pubDate>Tue, 06 Sep 2011 18:39:58 +0100</pubDate><category>IBM,</category><category>photo archive</category><category>1958</category></item><item><title>Home abroad</title><description>&lt;a href="http://www.nytimes.com/2008/06/19/garden/19argentina.html?pagewanted=1&amp;_r=1&amp;ex=1214452800;ei=5070;en=4201f1bdd73f4f9e;emc=eta1"&gt;Home abroad&lt;/a&gt;: &lt;p&gt;I still treasure my memories of two weeks spent in Buenos Aires almost 3 years ago, and this article has brought all of them back again :)&lt;/p&gt;</description><link>http://nopressure.co.uk/post/9875169789</link><guid>http://nopressure.co.uk/post/9875169789</guid><pubDate>Tue, 06 Sep 2011 13:18:56 +0100</pubDate><category>Argentina</category><category>Buenos Aires</category><category>Living Abroad</category></item><item><title>"Work smarter, play harder"</title><description>“Work smarter, play harder”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;Never got why we have to work hard… ;)&lt;/em&gt;</description><link>http://nopressure.co.uk/post/9827648807</link><guid>http://nopressure.co.uk/post/9827648807</guid><pubDate>Mon, 05 Sep 2011 09:19:30 +0100</pubDate><category>Work</category><category>Life</category><category>Balance</category><category>Work-Life-Balance</category></item><item><title>"Schmidt says definitively: the next generation of leaders and startups to emerge will involve..."</title><description>“Schmidt says definitively: the next generation of leaders and startups to emerge will involve mobile, local, and social. He explains that we’ve exhausted the limits of the PC as a platform, the future will be mobile first.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;Reinvent the future, everything else will follow.&lt;/em&gt;</description><link>http://nopressure.co.uk/post/9702965169</link><guid>http://nopressure.co.uk/post/9702965169</guid><pubDate>Fri, 02 Sep 2011 12:53:31 +0100</pubDate><category>Google</category><category>Schmidt</category><category>Local</category><category>Social</category><category>Web</category><category>evolution</category><category>technology</category><category>Media</category><category>media</category></item><item><title>Dublin sunset</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_lqldd2OeTp1qks0lto1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Dublin sunset&lt;/p&gt;</description><link>http://nopressure.co.uk/post/9456084123</link><guid>http://nopressure.co.uk/post/9456084123</guid><pubDate>Sat, 27 Aug 2011 15:53:26 +0100</pubDate><category>Dublin</category><category>tonight</category><category>sunset</category></item><item><title>Creative destruction</title><description>&lt;p&gt;From &lt;em&gt;Capitalism, Socialism and Democracy&lt;/em&gt; (New York: Harper, 1975)          [orig. pub. 1942] by &lt;span class="title"&gt;Joseph A. Schumpeter&lt;/span&gt;, pp. 82-85:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Capitalism, then, is by nature a form or method                    of economic change and not only never is but never can be stationary.                    And this evolutionary character of the capitalist process is                    not merely due to the fact that economic life goes on in a social                    and natural environment which changes and by its change alters                    the data of economic action; this fact is important and these                    changes (wars, revolutions and so on) often condition industrial                    change, but they are not its prime movers. Nor is this evolutionary                    character due to a quasi-automatic increase in population and                    capital or to the vagaries of monetary systems, of which exactly                    the same thing holds true. The fundamental impulse that sets                    and keeps the capitalist engine in motion comes from the new                    consumers, goods, the new methods of production or transportation,                    the new markets, the new forms of industrial organization that                    capitalist enterprise creates.&lt;br/&gt;&lt;/em&gt; &lt;/p&gt;</description><link>http://nopressure.co.uk/post/9120064382</link><guid>http://nopressure.co.uk/post/9120064382</guid><pubDate>Fri, 19 Aug 2011 13:17:37 +0100</pubDate><category>Creative Destruction</category><category>Schumpeter</category><category>Capitalism</category><category>Socialism</category><category>Democracy</category><category>Evolution</category><category>Destruction</category><category>Change</category></item></channel></rss>

