<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[GhettoCo.de]]></title>
  <link href="http://ghettoco.de/atom.xml" rel="self"/>
  <link href="http://ghettoco.de/"/>
  <updated>2012-07-29T01:19:37-04:00</updated>
  <id>http://ghettoco.de/</id>
  <author>
    <name><![CDATA[John Ford]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[Creating angularjs services in coffeescript]]></title>
    <link href="http://ghettoco.de/blog/2012/07/28/angularjs-services-in-coffeescript/"/>
    <updated>2012-07-28T23:26:00-04:00</updated>
    <id>http://ghettoco.de/blog/2012/07/28/angularjs-services-in-coffeescript</id>
    <content type="html"><![CDATA[<p>For my latest personal project, <a href="http://micbooker.com">MicBooker</a>, I&#8217;ve decided to go with the <a href="http://angularjs.org">AngularJS</a> framework.  In a very short amount of time, I&#8217;ve been able to get further, faster with Angular than I have with any of the other MV* javascript frameworks I&#8217;ve tried.  Nothing against the other frameworks, it just seem they&#8217;re all changing and improving so rapidly that the documentation isn&#8217;t keeping up.</p>

<p>So far, I&#8217;ve found Angulars docs to be much better and they even have several screencasts and tutorials to help you get up-to-speed quickly.  That said, I did run into my first issue that caused me a bit of head-scratching. It took me a couple of hours of experimentation to implement custom services and filters in Angular.</p>

<p>In case you&#8217;re having similar problems, here&#8217;s a brief outline of what worked for me.<!--more--></p>

<p>First, I load the vendored angular files using the pipeline. I also load my micbooker file where I create my app&#8217;s module and register it with Angular.</p>

<figure class='code'><figcaption><span>app/assets/javascripts/application.js</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
</pre></td><td class='code'><pre><code class='javascript'><span class='line'><span class="p">...</span>
</span><span class='line'><span class="c1">//= require angular-1.0.1/angular-1.0.1.min</span>
</span><span class='line'><span class="c1">//= require angular-1.0.1/angular-resource-1.0.1.min</span>
</span><span class='line'><span class="c1">//= require micbooker</span>
</span><span class='line'><span class="p">...</span>
</span></code></pre></td></tr></table></div></figure>


<p>Create my app module and make it available globally. I&#8217;m injecting the ngResource module, as well, which we&#8217;ll need for the RESTful resource later.</p>

<figure class='code'><figcaption><span>app/assets/javascrips/micbooker.js.coffee</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
</pre></td><td class='code'><pre><code class='coffeescript'><span class='line'><span class="nv">MicBooker = </span><span class="nx">angular</span><span class="p">.</span><span class="nx">module</span><span class="p">(</span><span class="s">&#39;MicBooker&#39;</span><span class="p">,</span> <span class="p">[</span><span class="s">&#39;ngResource&#39;</span><span class="p">])</span>
</span><span class='line'><span class="p">(</span><span class="nx">exports</span> <span class="o">?</span> <span class="k">this</span><span class="p">).</span><span class="nv">MicBooker = </span><span class="nx">MicBooker</span>
</span></code></pre></td></tr></table></div></figure>


<p>Now that I can access my application module from other parts of the app, here is an example of creating a filter.  This filters an array, returning an array of only those objects whose status is &#8220;confirmed&#8221;. (I&#8217;m using <a href="http://underscorejs.org">underscore.js&#8217;</a> filter method. It&#8217;s a great convenience library. Check it out.)</p>

<figure class='code'><figcaption><span>app/assets/javascripts/angular/filters/spots.js.coffee</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
</pre></td><td class='code'><pre><code class='coffeescript'><span class='line'><span class="nx">MicBooker</span><span class="p">.</span><span class="nx">filter</span><span class="p">(</span><span class="s">&#39;confirmed&#39;</span><span class="p">,</span> <span class="o">-&gt;</span>
</span><span class='line'>  <span class="nf">(inputArr) -&gt;</span>
</span><span class='line'>    <span class="k">return</span> <span class="nx">_</span><span class="p">(</span><span class="nx">inputArr</span><span class="p">).</span><span class="nx">filter</span><span class="p">(</span> <span class="nf">(element) -&gt;</span> <span class="nx">element</span><span class="p">.</span><span class="nx">status</span> <span class="o">==</span> <span class="s">&quot;confirmed&quot;</span><span class="p">)</span>
</span><span class='line'><span class="p">)</span>
</span></code></pre></td></tr></table></div></figure>


<p>And the thing that really drove me nuts was creating a service. ngResource already provides a nice interface for interacting with a back-end restful service.  But if you want to DRY up your app, you&#8217;ll want to create a wrapper so you don&#8217;t have $resource constructors all over the place.  I won&#8217;t bore you with all the things I tried.  But here&#8217;s what finally worked for me:</p>

<figure class='code'><figcaption><span>app/assets/javascripts/angular/services/spot_assignment.js.coffee</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
</pre></td><td class='code'><pre><code class='coffeescript'><span class='line'><span class="nx">MicBooker</span><span class="p">.</span><span class="nx">factory</span><span class="p">(</span><span class="s">&#39;SpotAssignment&#39;</span><span class="p">,</span> <span class="p">[</span><span class="s">&#39;$resource&#39;</span><span class="p">,</span>
</span><span class='line'>  <span class="nf">($resource) -&gt;</span>
</span><span class='line'>    <span class="nx">$resource</span><span class="p">(</span><span class="s">&#39;/users/:user_id/spot_assignments&#39;</span><span class="p">,</span>
</span><span class='line'>      <span class="p">{</span><span class="nx">user_id</span><span class="o">:</span><span class="nx">gon</span><span class="p">.</span><span class="nx">current_user</span><span class="p">.</span><span class="nx">id</span><span class="p">},</span>
</span><span class='line'>      <span class="p">{</span>
</span><span class='line'>        <span class="nv">query: </span><span class="p">{</span><span class="nx">method</span><span class="o">:</span><span class="s">&#39;GET&#39;</span><span class="p">,</span> <span class="nx">isArray</span><span class="o">:</span><span class="kc">true</span><span class="p">},</span>
</span><span class='line'>      <span class="p">}</span>
</span><span class='line'>    <span class="p">)</span>
</span><span class='line'>  <span class="p">]</span>
</span><span class='line'><span class="p">)</span>
</span></code></pre></td></tr></table></div></figure>


<p>Using my service in a controller would look something like this. Notice that I&#8217;m injecting into the controller the SpotAssignment service I created above.</p>

<figure class='code'><figcaption><span>app/assets/javascripts/angular/controllers/spots_ctrl.js.coffee</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
</pre></td><td class='code'><pre><code class='coffeescript'><span class='line'><span class="k">class</span> <span class="nx">SpotsCtrl</span>
</span><span class='line'>  <span class="nv">constructor: </span><span class="nf">(@$scope, SpotAssignment) -&gt;</span>
</span><span class='line'>  <span class="nv">$scope.spots = </span><span class="nx">gon</span><span class="p">.</span><span class="nx">spots</span>
</span><span class='line'>
</span><span class='line'>  <span class="nv">$scope.refreshSpots = </span><span class="o">-&gt;</span>
</span><span class='line'>    <span class="nx">SpotAssignment</span><span class="p">.</span><span class="nx">query</span><span class="p">(</span> <span class="nf">(result) -&gt;</span>
</span><span class='line'>      <span class="nv">$scope.spots = </span><span class="nx">result</span><span class="p">.</span><span class="nx">spots</span>
</span><span class='line'>    <span class="p">)</span>
</span></code></pre></td></tr></table></div></figure>


<p>And finally, using everything we&#8217;ve built in the html markup would look something like this:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
</pre></td><td class='code'><pre><code class='html'><span class='line'><span class="nt">&lt;html</span> <span class="na">lang=</span><span class="s">&quot;en&quot;</span> <span class="na">ng-app=</span><span class="s">&quot;MicBooker&quot;</span><span class="nt">&gt;</span>
</span><span class='line'>  <span class="nt">&lt;head&gt;&lt;/head&gt;</span>
</span><span class='line'>  <span class="nt">&lt;ul</span> <span class="na">class=</span><span class="s">&quot;unstyled&quot;</span><span class="nt">&gt;</span>
</span><span class='line'>    <span class="nt">&lt;li</span> <span class="na">ng-repeat=</span><span class="s">&quot;spot in spots | confirmed&quot;</span><span class="nt">&gt;</span>
</span><span class='line'>      Comic: 
</span><span class='line'>    <span class="nt">&lt;/li&gt;</span>
</span><span class='line'>  <span class="nt">&lt;/ul&gt;</span>
</span><span class='line'>  <span class="err">&lt;</span>%= link_to &#39;Refresh&#39;, &#39;#&#39;, &quot;ng-click&quot; =&gt; &quot;refreshSpots()&quot; %&gt;
</span><span class='line'><span class="nt">&lt;/html&gt;</span>
</span></code></pre></td></tr></table></div></figure>


<p>We&#8217;re using our custom filter to show only confirmed spots. And the refresh link uses ng-click to set the clickHandler to refreshSpots() which in turn uses our $resource wrapper to load the spots from the server.  If the array of spots has changed, angular&#8217;s data-bindings will take care of updating the UI for us. Slicker than snot on a glass door-knob, eh?  If you&#8217;re in the market for a JS framework, I suggest kicking the tires on Angular.  And if you do, hopefully this little writeup will help you avoid the minor speed-bumps I ran into.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Y'all cray]]></title>
    <link href="http://ghettoco.de/blog/2012/04/27/yall-cray/"/>
    <updated>2012-04-27T16:20:00-04:00</updated>
    <id>http://ghettoco.de/blog/2012/04/27/yall-cray</id>
    <content type="html"><![CDATA[<p>Technically, I currently work for a well-established company.  Workforce-wise, they&#8217;re not huge but their operations are significant.  Couple that with the fact that they deal primarily with banks, and it&#8217;s no surprise that their process is very &#8220;enterprisey&#8221;.  Luckily, I don&#8217;t &#8220;really&#8221; work for that company.  I&#8217;m the CTO of a much smaller &#8220;startup&#8221; that&#8217;s being seeded by the owner of said larger company.</p>

<p>It&#8217;s so funny to talk with the C# and Java developers from the parent company because they just don&#8217;t &#8220;get&#8221; how we work.  For instance, testing.  We&#8217;ll be consuming their services via a SOAP API (I said they were enterprisey).  Today, one of their devs came by my office to talk to me about the various error conditions and codes in their API.  Some of them will be newly created in their system specifically for how we&#8217;ll be using the system.  The developer assured me that they&#8217;d get them implemented as soon as possible so I can start to test my logic for handling them.</p>

<p>I told him not to worry and assured him that as long as the service will match the specs, then I can start writing and testing my code before they get finished building it.</p>

<p><em>&#8220;But how can you test hitting our service if it&#8217;s not built?&#8221;</em></p>

<p>&#8220;Oh, I could do it a bunch of ways but I&#8217;ll probably just stub out the calls with <a href="https://github.com/bblimke/webmock">webmock</a> or something. Even after the service is built, most of our tests won&#8217;t actually hit the service anyway unless I delete the <a href="https://www.relishapp.com/myronmarston/vcr/docs">VCR</a> cassettes.&#8221;</p>

<p><em>blink blink&#8230;stare&#8230;what&#8230;I don&#8217;t&#8230;did he just say VCR cassettes?</em></p>

<p>As he was walking away, I swear I heard him whisper under his breath, &#8220;That dude&#8217;s crazy&#8221;.</p>

<p>One of these days, I hope get a minute to sit down with those guys and show them how we run tests.  Until then, I guess we&#8217;ll just have to live with being those crazy kids down the hall.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Bootstrapping Design]]></title>
    <link href="http://ghettoco.de/blog/2012/03/20/bootstrapping-design/"/>
    <updated>2012-03-20T12:05:00-04:00</updated>
    <id>http://ghettoco.de/blog/2012/03/20/bootstrapping-design</id>
    <content type="html"><![CDATA[<p>I can&#8217;t count how many times I&#8217;ve started a new project, wireframed it, built it, and then had the whole thing fall apart when it came time to do the work of actually finishing the design.  Usually, it&#8217;s a personal project that, while you hope others may find some value in it, it&#8217;s not a money-making venture.  So I don&#8217;t want to spend much on it.</p>

<p>That means I definitely don&#8217;t want to pay a designer.  Nothing against designers.  I&#8217;m in awe of them and the products they produce.  I just can&#8217;t justify the cost of a good designer for a pet project that even I&#8217;m going to be <em>over</em> in a couple of months.  And if I&#8217;m going to use a not-so-great designer, I may as well do it myself.</p>

<p>That&#8217;s why I was intrigued by Jarrod Drysdale&#8217;s new ebook, <a href="http://bootstrappingdesign.com">Bootstrapping Design</a>.<!--more-->  It&#8217;s a design book specifically targetd towards developers and aims to help us make our projects suck less.  It states up front that it&#8217;s not going to make us world-class designers, but it will provide enough knowlege so we can DIY our projects design and do a good enough job to at least do justice to the hard work we&#8217;ve put into the functionality itself.  I&#8217;m down with that.</p>

<p>I initially balked at the price.  I can get an ebook <strong>and</strong> a hard-copy from somewhere like <a href="http://pragprog.com">Pragmatic</a> for $39!  But I continued on and downloaded the sample pdf.  Fonts!  Choosing fonts is exactly where I usually get completely overwhelmed with design.  There are so many choices.  And rules, rules I don&#8217;t know.  But I do know people make fun of you if you break the rules.  So I read through the sample chapter and now I think after a few more readings, I can safely pick fonts for a new project and not have to worry about my designer friends having to say, &#8220;bless his heart&#8221;, behind my back.</p>

<p>So I&#8217;m excited to read the rest of what this ebook has to offer.  If it helps my next project keep a designer from screaming and kicking a puppy, it&#8217;s worth it.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Paperclip defaults and the Asset Pipeline]]></title>
    <link href="http://ghettoco.de/blog/2012/03/19/paperclip-defaults-and-the-asset-pipeline/"/>
    <updated>2012-03-19T14:28:00-04:00</updated>
    <id>http://ghettoco.de/blog/2012/03/19/paperclip-defaults-and-the-asset-pipeline</id>
    <content type="html"><![CDATA[<p>The latest stable version of Paperclip hasn&#8217;t yet been updated for the Asset Pipeline.  This only affects the default image which is served if no file has been uploaded for the attached asset. If you&#8217;d like your default &#8220;missing&#8221; images served from image assets in the pipeline, configure the default_url like this:</p>

<figure class='code'><figcaption><span>app/model/foo.rb</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="k">class</span> <span class="nc">Foo</span> <span class="o">&lt;</span> <span class="no">ActiveRecord</span><span class="o">::</span><span class="no">Base</span>
</span><span class='line'>  <span class="n">has_attached_file</span> <span class="ss">:avatar</span><span class="p">,</span>
</span><span class='line'>    <span class="ss">:styles</span> <span class="o">=&gt;</span> <span class="p">{</span><span class="ss">:small</span> <span class="o">=&gt;</span> <span class="s2">&quot;300x300&gt;&quot;</span><span class="p">,</span> <span class="ss">:thumbnail</span> <span class="o">=&gt;</span> <span class="s2">&quot;80x80#&quot;</span><span class="p">},</span>
</span><span class='line'>    <span class="ss">:default_url</span> <span class="o">=&gt;</span> <span class="no">ActionController</span><span class="o">::</span><span class="no">Base</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">asset_path</span><span class="p">(</span><span class="s1">&#39;missing_:style.png&#39;</span><span class="p">)</span>
</span><span class='line'><span class="k">end</span>
</span></code></pre></td></tr></table></div></figure>


<!--more-->


<p>Now just put your default images –in this case <em>missing_original.png</em>, <em>missing_small.png</em>, and <em>missing_thumbnail.png</em>– into the directory <em>app/assets/images</em> and they&#8217;ll be used as the default images for your model.</p>

<p>Of course, you can also place the files somewhere under the public directory to allow your webserver to serve the file directly.  This makes sense if you&#8217;re using local storage for the files.  You don&#8217;t want to put the uploaded files or their derivatives in the asset pipeline since they are static files and won&#8217;t need any of the preprocessing that the pipeline offers.  But if you&#8217;re using Amazon S3 or another storage system for uploaded files and want to keep your limited image assets together in your app codebase, now you know how.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Multiple Asset Pipelines]]></title>
    <link href="http://ghettoco.de/blog/2012/03/18/multiple-asset-pipelines/"/>
    <updated>2012-03-18T14:04:00-04:00</updated>
    <id>http://ghettoco.de/blog/2012/03/18/multiple-asset-pipelines</id>
    <content type="html"><![CDATA[<p>I&#8217;m working on a project that needs both mobile and web interfaces. We&#8217;re building the mobile interface with Sencha Touch and the web version with good ol&#8217; jQuery.</p>

<p>I setup the app for mobile similar to Ryan Bates&#8217; <a href="http://railscasts.com/episodes/199-mobile-devices">Mobile Devices RailsCast</a>.  This allows us to serve different views to the client depending on whether or not the device is a mobile device.</p>

<p>But what about the javascript and coffescript?  We&#8217;re going to need different behaviour on the client side depending on which view is rendered and I want it all to take advantage of the Asset Pipeline.  So I decided to try and make a parallel asset pipeline <!--more--> so I can do something like this:</p>

<figure class='code'><figcaption><span>&#8220;app/views/layouts/application.mobile.erb&#8221;</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
</pre></td><td class='code'><pre><code class='erb'><span class='line'><span class="x">&lt;head&gt;</span>
</span><span class='line'><span class="x">  ...</span>
</span><span class='line'><span class="x">  </span><span class="cp">&lt;%=</span> <span class="n">stylesheet_link_tag</span>    <span class="s2">&quot;mobile&quot;</span><span class="p">,</span> <span class="ss">:media</span> <span class="o">=&gt;</span> <span class="s2">&quot;all&quot;</span> <span class="cp">%&gt;</span><span class="x"></span>
</span><span class='line'><span class="x">  </span><span class="cp">&lt;%=</span> <span class="n">javascript_include_tag</span> <span class="s2">&quot;mobile&quot;</span> <span class="cp">%&gt;</span><span class="x"></span>
</span><span class='line'><span class="x">  ...</span>
</span><span class='line'><span class="x">&lt;/head&gt;</span>
</span></code></pre></td></tr></table></div></figure>


<p>And have Sprockets build the coffescript, javascript, and css the same as this:</p>

<figure class='code'><figcaption><span>&#8220;app/views/layouts/application.html.erb&#8221;</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
</pre></td><td class='code'><pre><code class='erb'><span class='line'><span class="x">  ...</span>
</span><span class='line'><span class="x">  </span><span class="cp">&lt;%=</span> <span class="n">stylesheet_link_tag</span>    <span class="s2">&quot;application&quot;</span><span class="p">,</span> <span class="ss">:media</span> <span class="o">=&gt;</span> <span class="s2">&quot;all&quot;</span> <span class="cp">%&gt;</span><span class="x"></span>
</span><span class='line'><span class="x">  </span><span class="cp">&lt;%=</span> <span class="n">javascript_include_tag</span> <span class="s2">&quot;application&quot;</span> <span class="cp">%&gt;</span><span class="x"></span>
</span><span class='line'><span class="x">  ...</span>
</span></code></pre></td></tr></table></div></figure>


<p>I decided to create an asset structure under <em>app/assets/mobile</em> to house the javascripts, stylesheets, and images for the mobile app.  Then, I added those directories to the Sprockets search path.</p>

<figure class='code'><figcaption><span>&#8220;config/application.rb&#8221;</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="sx">%w[javascripts stylesheets images]</span><span class="o">.</span><span class="n">each</span> <span class="k">do</span> <span class="o">|</span><span class="n">dir</span><span class="o">|</span>
</span><span class='line'>  <span class="n">config</span><span class="o">.</span><span class="n">assets</span><span class="o">.</span><span class="n">paths</span> <span class="o">&lt;&lt;</span> <span class="no">Rails</span><span class="o">.</span><span class="n">root</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="s2">&quot;app&quot;</span><span class="p">,</span> <span class="s2">&quot;assets&quot;</span><span class="p">,</span> <span class="s2">&quot;mobile&quot;</span><span class="p">,</span> <span class="n">dir</span><span class="p">)</span>
</span><span class='line'><span class="k">end</span>
</span></code></pre></td></tr></table></div></figure>


<p>mobile.js first require&#8217;s Sencha Touch and then requires all of the coffeescript and javascript under in the <em>app/assets/mobile/javascripts</em> directory.</p>

<figure class='code'><figcaption><span>&#8220;app/assets/javascripts/mobile.js&#8221;</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
</pre></td><td class='code'><pre><code class='javascript'><span class='line'><span class="c1">//= require sencha-touch-all-debug</span>
</span><span class='line'><span class="c1">//= require_tree .</span>
</span></code></pre></td></tr></table></div></figure>


<p>Similarly, mobile.css requires all the files under the strylesheets directory structure:</p>

<figure class='code'><figcaption><span>&#8220;app/assets/stylesheets/mobile.css&#8221;</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
</pre></td><td class='code'><pre><code class='css'><span class='line'><span class="c">/*</span>
</span><span class='line'><span class="c"> *= require_self</span>
</span><span class='line'><span class="c"> *= require_tree .</span>
</span><span class='line'><span class="c">*/</span>
</span></code></pre></td></tr></table></div></figure>


<p>Now we&#8217;re ready to require the mobile.js and mobile.css in our mobile layout and have a clean seperation of the javascript and css between the mobile and web versions of our app.</p>
]]></content>
  </entry>
  
</feed>
