<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jadam on Medium]]></title>
        <description><![CDATA[Stories by Jadam on Medium]]></description>
        <link>https://medium.com/@MrJadaml?source=rss-649a3b0beac7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Tk7sQtF1KbVFbXcc.jpeg</url>
            <title>Stories by Jadam on Medium</title>
            <link>https://medium.com/@MrJadaml?source=rss-649a3b0beac7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 09:18:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@MrJadaml/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Setting up AWS for Carrierwave]]></title>
            <link>https://medium.com/gschool-chronicles/setting-up-aws-for-carrierwave-17fa15377c19?source=rss-649a3b0beac7------2</link>
            <guid isPermaLink="false">https://medium.com/p/17fa15377c19</guid>
            <dc:creator><![CDATA[Jadam]]></dc:creator>
            <pubDate>Mon, 22 Dec 2014 23:39:38 GMT</pubDate>
            <atom:updated>2015-01-26T11:02:28.400Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*Jvk5XBS6EAnGxAZRSCmJgg.jpeg" /></figure><p>Its only a handful of steps to get this up and running, but I found the docs were’t quite as explicit as I would have liked. In addition to having to add the fog gem you’ll also likely find you’ll want the dotenv gem aswell.</p><p>The fog gem can be dropped in your main group, but the dotenv-rails gem will need to be added with groups =&gt;[:development, :test] if you don’t already have that group.</p><pre>gem ‘fog’<br>gem ‘dotenv-rails’, :groups =&gt; [:development, :test]</pre><p>In your terminal run:</p><pre>$ bundle</pre><p>At the top level of your application’s tree create a .env and .env.example file.</p><p>In your .env file is where you’ll put your AWS keys. My file looks something like this:</p><pre>S3_KEY=s0m3_b1g_10ng_str!ng_0f_stuff<br>S3_SECRET=s0m3_b1g_10ng_str!ng_0f_stuff<br>S3_BUCKET=&quot;bucket_file_name&quot;</pre><p>You’ll be copying everything from your .env file into your .evn.example file, but without all the secret values you filled in. The file only has the keys/variables and look something like the example below:</p><pre>S3_KEY=<br>S3_SECRET=<br>S3_BUCKET=</pre><p>This .env.example file is for anyone else who may be working off your code and lets them know what keys they’ll need to provide to get things running on their environment.</p><p>Next inside config/initializers create a carrierwave.rb file in which you’ll add:</p><pre>CarrierWave.configure do |config|<br>  config.fog_credentials = {<br>    :provider =&gt; ‘AWS’,<br>    :aws_access_key_id =&gt; ENV[‘S3_KEY’],<br>    :aws_secret_access_key =&gt; ENV[‘S3_SECRET’],<br>  }<br>  config.fog_directory = ENV[‘S3_BUCKET’]<br>end</pre><p>I’ve left out a few of the optional fields that are listed in Carrierwave’s docs. Then inside your XXXX_uploader.rb file uncomment the “storage :fog” option. Short of committing your changes that’s about it. One last step you’ll need to take if you’re using Heroku is setting those keys.</p><p>when pushing to Heroku you’ll need to set your AWS secrets separately:</p><pre>$ heroku config:set S3_KEY=s0m3_b1g_10ng_str!ng_0f_stuff S3_SECRET=s0m3_b1g_10ng_str!ng_0f_stuff S3_BUCKET=yourbucketname</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17fa15377c19" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gschool-chronicles/setting-up-aws-for-carrierwave-17fa15377c19">Setting up AWS for Carrierwave</a> was originally published in <a href="https://medium.com/gschool-chronicles">gSchool Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pull Request in One Minute]]></title>
            <link>https://medium.com/gschool-chronicles/pull-request-in-one-minute-a714581cacd1?source=rss-649a3b0beac7------2</link>
            <guid isPermaLink="false">https://medium.com/p/a714581cacd1</guid>
            <dc:creator><![CDATA[Jadam]]></dc:creator>
            <pubDate>Mon, 10 Nov 2014 23:40:39 GMT</pubDate>
            <atom:updated>2014-11-10T23:40:39.145Z</atom:updated>
            <content:encoded><![CDATA[<p>First off you should be doing all your work in a new branch. Once you’re code is ready for production run your typical Git status, add and commit commands. Your push will need to include the branch name. Something like the following:</p><pre>$ git push desc-exercises </pre><p>After you’ve pushed head over to Github and jump into the repo you’re making a pull request to. Near the top you should see the name of the branch you just pushed highlighted in yellow. On the right there will be a green button that says ‘Compate &amp; pull request’. Click that button and you will be taken to a view page of your push with yet another green button to click, ‘Create pull request’. Once you’ve hit that one your request is submitted for review by the overlords.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a714581cacd1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gschool-chronicles/pull-request-in-one-minute-a714581cacd1">Pull Request in One Minute</a> was originally published in <a href="https://medium.com/gschool-chronicles">gSchool Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ruby on Rails basics]]></title>
            <link>https://medium.com/code-for-denver-ruby/ruby-on-rails-basics-8ca2d4c5a266?source=rss-649a3b0beac7------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ca2d4c5a266</guid>
            <dc:creator><![CDATA[Jadam]]></dc:creator>
            <pubDate>Sat, 08 Nov 2014 21:42:45 GMT</pubDate>
            <atom:updated>2014-11-08T22:54:40.662Z</atom:updated>
            <content:encoded><![CDATA[<h4>Setting up HAML &amp; Bootstrap</h4><p>Building off of the basic CRUD app I made from post on <a href="https://medium.com/gschool-chronicles/this-is-how-you-do-basic-crud-5777b9445ac5">This is how you do basic CRUD</a> we will be adding Twitter Bootstrap to it and swapping it over from Html to Haml. Twitter Bootstrap is a Haml is an Html abstraction language that I enjoy as it makes quickly scanning through my code base much easier.</p><h4>Installing Bootstrap</h4><p>Bootstrap is pretty quick and easy to get setup. First lets add the <em>bootstrap-sass </em>&amp; <em>autoprefixer</em> gems to our <em>Gemfile</em>. Go ahead and clear out all those commented lines of code. Your file should look something similar to this:</p><pre>source ‘<a href="https://rubygems.org'/">https://rubygems.org&#39;</a></pre><pre>gem ‘rails’, ‘4.2.0.beta2&#39;<br>gem ‘pg’<br><strong>gem ‘autoprefixer-rails’<br>gem ‘bootstrap-sass’, ‘~&gt; 3.2.0&#39;</strong><br>gem ‘sass-rails’, ‘~&gt; 5.0.0.beta1&#39;<br>gem ‘uglifier’, ‘&gt;= 1.3.0&#39;<br>gem ‘coffee-rails’, ‘~&gt; 4.0.0&#39;<br>gem ‘jquery-rails’, ‘~&gt; 4.0.0.beta2&#39;<br>gem ‘jbuilder’, ‘~&gt; 2.0&#39;<br>gem ‘sdoc’, ‘~&gt; 0.4.0&#39;, group: :doc</pre><pre>group :development, :test do<br> gem ‘byebug’<br> gem ‘web-console’, ‘~&gt; 2.0.0.beta4&#39;<br> gem ‘spring’<br>end</pre><p>Any time you add a gem to your Gemfile you will need to run the <em>bundle </em>command<em> </em>in your terminal:</p><pre>$ bundle</pre><p>We’ll jump over to our <em>/assets </em>directory to do the last two steps of the setup. In our css folder we’ll add these two lines of code at the bottom:<br><strong>app/assets/stylesheets/application.css</strong></p><pre><a href="http://twitter.com/import">@import</a> “bootstrap-sprockets”;<br><a href="http://twitter.com/import">@import</a> “bootstrap”;</pre><p>We’ll also need to change the file name from <em>application.css</em> to <em>application.css.</em><strong><em>scss</em></strong></p><p>One more one liner and we’re done with basic Bootstrap Add <em>//= require</em> <em>bootstrap-sprockets</em> inside your application.js file.<br><strong>app/assets/javascript/application.js</strong></p><pre>//= require jquery<br><strong>//= require bootstrap-sprockets</strong><br>//= require jquery_ujs<br>//= require_tree .</pre><blockquote>If you had your rails server running you will need to restart it.</blockquote><h4>Setting up Haml</h4><p>Now over to Haml which is as simple as two things. Add the Haml gem to the <em>Gemfile…</em></p><pre>gem ‘autoprefixer-rails’<br>gem ‘jbuilder’, ‘~&gt; 2.0&#39;<br><strong>gem ‘haml’</strong><br>gem ‘sdoc’, ‘~&gt; 0.4.0&#39;, group: :doc</pre><p>… and the second step is just to remember that whenever you create a new view file that instead of having it formated with an erb extension, al la <em>filename.html.erb</em> it ends instead with .haml <em>filename.html.</em><strong><em>haml</em></strong></p><p>There’s <strong>a lot </strong>you can do with Bootstrap and you really should dig through the documentation on <a href="http://getbootstrap.com/">their site</a>. Should you have ran into any issues with setting up Bootstrap I suggest you check out their <a href="https://github.com/twbs/bootstrap-sass">Github readme.</a></p><p>If the Haml walkthrough leaves you a bit curious you can read more with this short post <a href="https://medium.com/gschool-chronicles/what-is-haml-you-ask-to-the-extent-ive-been-using-it-its-a-way-to-write-out-html-and-rubys-html-ed9d38af5bbf">Haml: form &amp;&amp; function</a>.</p><p>Available for Qs on Twitter: <a href="http://twitter.com/mrjadaml">@MrJadaml</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ca2d4c5a266" width="1" height="1" alt=""><hr><p><a href="https://medium.com/code-for-denver-ruby/ruby-on-rails-basics-8ca2d4c5a266">Ruby on Rails basics</a> was originally published in <a href="https://medium.com/code-for-denver-ruby">Ruby on Rails::Basics</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[This is how you do basic CRUD:]]></title>
            <link>https://medium.com/gschool-chronicles/this-is-how-you-do-basic-crud-5777b9445ac5?source=rss-649a3b0beac7------2</link>
            <guid isPermaLink="false">https://medium.com/p/5777b9445ac5</guid>
            <dc:creator><![CDATA[Jadam]]></dc:creator>
            <pubDate>Thu, 06 Nov 2014 16:17:15 GMT</pubDate>
            <atom:updated>2015-01-14T16:48:58.850Z</atom:updated>
            <content:encoded><![CDATA[<h2>This is how you CRUD</h2><p>This run through is structured in a way that wont stop to explain all the small things about syntax or purpose or files and methods. Rather we will be going through a process of <em>error driven development </em>to guide us along our crudding journey. CRUD, or Create Read Update Destroy, is a core element of building in Ruby on Rails and many other languages. There are plenty of resources out there that provide a much more in depth explanation of what CRUD is, but we’re going to jump right into knocking out some CRUD here.</p><p>Open up your terminal to start out, and punch the following lines of code in, one row at a time.</p><pre>$ rails new widgets -—database=postgresql<br>$ cd widgets<br>$ bundle<br>$ rake db:create</pre><p>In a second terminal tab run your rails server</p><pre>$ rails s</pre><p>Now head over to your browser and enter <em>localhost:3000 </em>into your address bar. You should see the <a href="http://guides.rubyonrails.org/images/getting_started/rails_welcome.png">Rails Welcome Page</a>.</p><p>Back in terminal we’ll generate a database table for some widgets to CRUD and then open up our <a href="https://atom.io/">Atom editor</a> to check out the file.</p><pre>$ rails g migration MyWidgetsAndThings<br> invoke active_record<br> create db/migrate/20141106150725_my_widgets_and_things.rb<br>$ atom .</pre><p>Now in the text editor we’ll create a new database table by putting in the following code within the existing <em>def change </em>and <em>end </em>block.<br><strong>db/migrate/20141106150725_my_widgets_and_things.rb</strong></p><pre>create_table :widgets do |t|<br> t.string :name<br> t.string :description<br> t.integer :age<br>end</pre><p>Additional datatypes to choose from: <a href="http://stackoverflow.com/questions/17918117/rails-4-datatypes">http://stackoverflow.com/questions/17918117/rails-4-datatypes</a></p><p>Once our widgets database table is created we’ll head back over to the terminal and <em>migrate </em>those changes.</p><pre>$ rake db:migrate</pre><pre>== 20141106025705 MyWidgetsAndThings: migrating ==================<br> —  create_table(:widgets)<br> -&gt; 0.0052s<br>== 20141106025705 MyWidgetsAndThings: migrated (0.0053s) =========</pre><blockquote><em>Your terminal output should look something like the one above</em></blockquote><p>That should be the last time we’ll need the terminal for a while. Back over in Atom, open up your <em>routes.rb </em>file. We will be adding in two lines here: <em>resources :widgets </em>and <em>root ‘widgets#index’</em><br><strong>config/routes.rb</strong></p><pre>Rails.application.routes.draw do<br> resources :widgets<br> root ‘widgets#index’<br>end</pre><blockquote><em>You can delete all the commented out text (the light grey text with hashtags in front of it) If you choose to do that your file should have 4 lines like the code above.</em></blockquote><p>Next create a file inside of your <em>apps/controllers </em>directory, name it<br><em>widgets_controller.rb </em>and drop in the following code to set your index action.<br><strong>app/controllers/widgets_controller.rb</strong></p><pre>class WidgetsController &lt; ApplicationController<br> def index<br> end<br>end</pre><blockquote><em>Check localhost:3000 ~&gt; We have our first desired error: ‘The action ‘index’ could not be found for PlantsController’</em></blockquote><p>So lets add an index action. Create a folder named <em>widgets </em>within the <em>app/views </em>directory. Then create a file named <em>index.html.erb </em>and add in the following code:<br><strong>app/views</strong></p><pre>&lt;h1&gt;Widgets&lt;/h1&gt;<br> &lt;%= link_to ‘New Widget’, new_widget_path %&gt;</pre><blockquote>Check localhost:3000 ~&gt; Click on the ‘New Widget’ link. You should be rewarded with a fail message stating: ‘action new could not be found’</blockquote><p>To resolve that disconnect provide your controller with that new action:<br><strong>app/controllers/widgets_controller.rb</strong></p><pre>def new<br>end</pre><blockquote>Check localhost:3000/widgets/new ~&gt; Our first ‘Missing template’ error.</blockquote><p>Create a view file named <em>new.html.erb </em>inside of your <em>app/views/widgets </em>directory and enter in the following code:<br><strong>app/views/widgets</strong></p><pre>&lt;h1&gt;Widget Factory&lt;/h1&gt;<br>&lt;%= form_for <a href="http://twitter.com/widget">@widget</a> do |f| %&gt;<br> &lt;%= f.label :name %&gt;<br> &lt;%= f.text_field :name %&gt;</pre><pre>&lt;%= f.label :description %&gt;<br> &lt;%= f.text_field :description %&gt;</pre><pre>&lt;%= f.label :age %&gt;<br> &lt;%= f.text_field :age %&gt;</pre><pre>&lt;%= f.submit %&gt;<br>&lt;% end %&gt;</pre><blockquote>Check localhost:3000/widgets/new ~&gt; Here we get a ‘<em>First argument in form cannot contain nil or be empty’ error as expected.</em></blockquote><p>Backover in our <em>new </em>action within the controller we’ll add the following line of code: <a href="http://twitter.com/widget"><em>@widget</em></a><em> = Widget.new</em></p><p><strong>app/controllers/widgets_controller.rb</strong></p><pre>def new<br> <a href="http://twitter.com/widget">@widget</a> = Widget.new<br>end</pre><blockquote>Check localhost:3000/widgets/new ~&gt; You should get ‘<em>uninitialized constant PlantsController::Plant’ </em>If you happen to get the following error <em>‘</em>undefined method `new’ for Widget:Module’ tweet at me to resolve it.</blockquote><p>This means we need a Model. To create one well need to add a file named <em>widget.rb (</em>singular widget) inside the <em>app/models </em>directory with the code:<br><strong>app/models</strong></p><pre>class Widget &lt; ActiveRecord::Base</pre><pre>end</pre><blockquote>Check localhost:3000<em>/widgets/new ~&gt; We should now have our new page with fields and a button. Click that button and you should get ‘The action ‘create’ could not be found for WidgetsController</em></blockquote><p>We need a <em>create </em>action. Drop the following code into your controller under you new action:<br><strong>app/controllers/widgets_controller.rb</strong></p><pre>def create<br>end</pre><blockquote>Check localhost:3000/widgets/new ~&gt; Click that button again and you will see a ‘<em>missing template</em>’ error.</blockquote><p>Unlike new, create does not need a view. Instead we will just redirect users back to the index page after they create a new widget with <em>redirect_to root_path </em>in our create action.<br><strong>app/controllers/widgets_controller.r</strong></p><pre>def create<br> redirect_to root_path<br>end</pre><blockquote><em>Create a widget<br></em>Check localhost:3000/widgets/new ~&gt; Clicking the button again you will be sent to your index page.</blockquote><p>That’s great, but it doesn’t actually save the data you filled in the fields. To accomplish that drop the following code inside your create action, <strong>above </strong>the redirect you just added.<br><strong>/controllers/widgets_controller.rb</strong></p><pre>def create<br> <a href="http://twitter.com/widget">@widget</a> = Widget.new(params.require(:widget)<br> .permit(:name, :destroy, :age))<br> <a href="http://twitter.com/widget">@widget</a>.save<br> redirect_to root_path<br>end</pre><blockquote>Check localhost:3000/widgets/new <em>~&gt; Fill in the fields and click the button. Nothing will show, but it is saving now.</em></blockquote><p>The first step in getting it to show we will be to add a table into our <em>index.html.erb </em>file.<br><strong>views/widgets/index.html.erb</strong></p><pre>&lt;% <a href="http://twitter.com/widgets">@widgets</a>.each do |widget| %&gt;<br> &lt;table&gt;<br> &lt;tr&gt;<br> &lt;th&gt;Name&lt;/th&gt;<br> &lt;th&gt;Description&lt;/th&gt;<br> &lt;th&gt;Age&lt;/th&gt;<br> &lt;/tr&gt;<br> &lt;tr&gt;<br> &lt;td&gt;&lt;%= widget.name %&gt;&lt;/td&gt;<br> &lt;td&gt;&lt;%= widget.description %&gt;&lt;/td&gt;<br> &lt;td&gt;&lt;%= widget.age %&gt;&lt;/td&gt;<br> &lt;td&gt;&lt;%= link_to ‘Edit’, ‘#’ %&gt;&lt;/td&gt;<br> &lt;td&gt;&lt;%= link_to ‘Show’, ‘#’ %&gt;&lt;/td&gt;<br> &lt;td&gt;&lt;%= link_to ‘Delete’, ‘#’ %&gt;&lt;/td&gt;<br> &lt;/tr&gt;<br> &lt;/table&gt;<br>&lt;% end %&gt;</pre><blockquote>Check localhost:3000 <em>~&gt; There’s a place for it to show now but we’re getting a ‘undefined method `each’ for nil:NilClass’ error.</em></blockquote><p><strong>/controllers/widgets_controller.rb<br></strong>Drop the following code inside your new action:<br>`<a href="http://twitter.com/widgets">@widgets</a> = Widget.all`</p><blockquote>Check localhost:3000 <em>~&gt; Widgets appear!</em></blockquote><p><strong>/views/widgets/index.html.erb<br></strong>Next we’ll replace the hashtag and quotes for the ‘Edit’ `link_to`line of code with `edit_widget_path(widget)` so that it looks like the following:</p><pre>…<br> &lt;td&gt;&lt;%= plant.age %&gt;&lt;/td&gt;<br> &lt;td&gt;&lt;%= link_to ‘Edit’, <strong>edit_widget_path(widget) </strong>%&gt;&lt;/td&gt;<br> &lt;td&gt;&lt;%= link_to ‘Show’, ‘#’ %&gt;&lt;/td&gt;<br>…</pre><blockquote>Check localhost:3000 <em>~&gt; If you click our updated “edit” link you will get: “The action ‘edit’ could not be found for WidgetsController”</em></blockquote><p>Under your create action add an edit action the same way you did for index, new, and create.<br><strong>/controllers/widgets_controller.rb</strong></p><pre>def edit<br>end</pre><blockquote>Check localhost again <em>~&gt; Do a hard refresh on the page and get: ‘Missing template widgets/edit’</em></blockquote><p>Create a new view called <em>edit.html.erb </em>inside your <em>/views/widgets </em>directory and add the following code:<br><strong>/views/widgets</strong></p><pre>&lt;h1&gt;Edit Widget&lt;/h1&gt;<br>&lt;%= form_for <a href="http://twitter.com/widget">@widget</a> do |f| %&gt;<br> &lt;%= f.label :name %&gt;<br> &lt;%= f.text_field :name %&gt;</pre><pre>&lt;%= f.label :description %&gt;<br> &lt;%= f.text_field :description %&gt;</pre><pre>&lt;%= f.label :age %&gt;<br> &lt;%= f.text_field :age %&gt;</pre><pre>&lt;%= f.submit %&gt;<br>&lt;% end %&gt;</pre><blockquote>Check localhost:3000/widgets/1/edit <em>~&gt; </em>And get this message: <em>‘First argument in form cannot contain nil or be empty’</em></blockquote><p>Back in your controller add <a href="http://twitter.com/widget"><em>@widget</em></a><em> = Widget.find(params[:id]) </em>inside your new edit action, so that it looks like this:<strong><br>/controllers/widgets_controller.rb</strong></p><pre>def edit<br> <a href="http://twitter.com/widget">@widget</a> = Widget.find(params[:id])<br>end</pre><blockquote>Check localhost:3000<em>/widgets/1/edit ~&gt; Click ‘Update Widget’ button and get this error: ‘The action ‘update’ could not be found for WidgetsController’</em></blockquote><p>Under your edit action add an update action.<br><strong>/controllers/widgets_controller.rb</strong></p><pre>def update<br>end</pre><blockquote>Check localhost:3000/widgets/1/edit <em>~&gt; ‘Missing template widgets/update’</em></blockquote><p>Update doesn’t get a view. We just want to make sure all the data is updated for our widget. `if` that happens we will just redirect the user to the index. `Else` should that not happen we’ll render the edit page again:<br><strong>/controllers/widgets_controller.rb</strong></p><pre>def edit<br>  <a href="http://twitter.com/widget"><strong>@widget</strong></a><strong> = Widget.find(params[:id])<br> if </strong><a href="http://twitter.com/widget"><strong>@widget</strong></a><strong>.update(params.require(:widget)<br> .permit(:name, :description, :age)<br> redirect_to root_path<br> else<br> render :edit<br> end</strong><br>end</pre><blockquote>Check localhost:3000/widgets/1/edit <em>~&gt; We should see that the changes we made work when you click the update button.</em></blockquote><p>Next up the show link. Let’s fix that it currently doesn’t go anywhere by replacing the `’#’` with the path `widget_path(widget)`<br><strong>/views/widgets/index.html.erb</strong></p><pre>…<br> &lt;td&gt;&lt;%= link_to ‘Edit’, edit_widget_path(widget) %&gt;&lt;/td&gt;<br> &lt;td&gt;&lt;%= link_to ‘Show’, <strong>widget_path(widget) </strong>%&gt;&lt;/td&gt;<br> &lt;td&gt;&lt;%= link_to ‘Delete’, ‘#’ %&gt;&lt;/td&gt;<br>…</pre><blockquote>Check localhost:3000 <em>~&gt; The action ‘show’ could not be found for WidgetsController is what we’ll get when we click the show link.</em></blockquote><p>Under your update action add a show action.<br><strong>/controllers/widgets_controller.rb</strong></p><pre>def show<br>end</pre><blockquote>Check localhost:3000/widgets/1 <em>~&gt; ‘Missing template widgets/show’</em></blockquote><p>Create a new view called <em>show.html.erb </em>and insert the following code:<br><strong>/views/widgets</strong></p><pre>&lt;h1&gt;&lt;%= <a href="http://twitter.com/widget">@widget</a>.name %&gt;&lt;/h1&gt;<br>&lt;%= <a href="http://twitter.com/widget">@widget</a>.description %&gt;&lt;/br&gt;<br>&lt;%= <a href="http://twitter.com/widget">@widget</a>.age %&gt;&lt;/br&gt;<br>&lt;%= link_to ‘All Widgets’, widgets_path %&gt; |<br>&lt;%= link_to ‘Edit’, edit_widget_path(<a href="http://twitter.com/widget">@widget</a>) %&gt;</pre><blockquote><em>Check 3000/widgets/1 ~&gt; We get a ‘NoMethodError’: ‘undefined method `name’ for nil:NilClass’ because we haven’t set our widgets instance variable in the show action yet.</em></blockquote><p>Add: <a href="http://twitter.com/widget"><em>@widget</em></a><em> = Widget.find(params[:id]) </em>Inside your show action.<br><strong>/controllers/widgets_controller.rb</strong></p><pre>def show<br> <a href="http://twitter.com/widget">@widget</a> = Widget.find(params[:id])<br>end</pre><blockquote>Check localhost:3000/widgets/1 <em>~&gt; You’ll see your widget’s name in bold and its description and age. Click the ‘All Widgets’ link to get back to the index page.</em></blockquote><p><strong>/views/widgets/index.html.erb<br></strong>Swap <em>project_path(project) </em>for the final <em>’#’ </em>in the delete link. We’ll also add in a comma and additional functionality that the destroy action requires in the form of: <em>, method: :delete</em></p><p>The full line should now look something like this:</p><pre>…<br> &lt;td&gt;&lt;%= link_to ‘Show’, plant_path(plant) %&gt;&lt;/td&gt;<br> &lt;td&gt;&lt;%= link_to ‘Delete’, <strong>project_path(project), method: :delete </strong>%&gt;&lt;/td&gt;<br> &lt;/tr&gt;<br>…</pre><blockquote>Check localhost:3000 <em>~&gt; Click on your ‘Delete’ link and you should get a familiar ‘Unknown action’ fail screen.</em></blockquote><p>To remedy that we will add a destroy action.<br><strong>/controllers/widgets_controller.rb</strong></p><pre>def destroy<br>end</pre><blockquote>Check localhost:3000 <em>~&gt; Now the expected ‘Template is missing’ fail screen.</em></blockquote><p>Just like our create and update actions, the destroy action will not require a<br>view. Instead we will verify the widget, destroy the widget, and then redirect the user to the index page within the action with the following code:<br><strong>/controllers/widgets_controller.rb</strong></p><pre>def destroy<br> <a href="http://twitter.com/widget">@widget</a> = Widget.find(params[:id])<br> <a href="http://twitter.com/widget">@widget</a>.destroy<br> redirect_to widgets_path<br>end</pre><blockquote>Check localhost:3000 <em>~&gt; Click the ‘Delete’ link and it should disappear.</em></blockquote><p>Congratulations! You’re the proud owner of a very ugly and useless web app. Feel free to mess around with the code, break it, add some bootstrap, add another round of crud, whatever you want.</p><p>I hope this was a helpful tutorial for CRUD. Consider going back though and googling any terms, concepts, or syntax you want to have a deeper understanding of. Once you can get through this process with minimal referencing you will be on your way to develpoing Ruby on Rails apps.</p><p><em>A markdown version of this CRUD run-through is available on my github: </em><a href="https://github.com/MrJadaml/widgets"><em>https://github.com/MrJadaml/widgets</em></a><em> .</em></p><p><em>If you have any question feel free to comment in the side bar or tweet at me: </em><a href="http://www.twitter.com/mrjadaml"><em>@Mrjadaml</em></a></p><p>…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5777b9445ac5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gschool-chronicles/this-is-how-you-do-basic-crud-5777b9445ac5">This is how you do basic CRUD:</a> was originally published in <a href="https://medium.com/gschool-chronicles">gSchool Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is HAML you ask? To the extent I’ve been using it it’s a way to write out HTML and Ruby’s HTML…]]></title>
            <link>https://medium.com/gschool-chronicles/what-is-haml-you-ask-to-the-extent-ive-been-using-it-its-a-way-to-write-out-html-and-rubys-html-ed9d38af5bbf?source=rss-649a3b0beac7------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed9d38af5bbf</guid>
            <dc:creator><![CDATA[Jadam]]></dc:creator>
            <pubDate>Mon, 20 Oct 2014 05:17:44 GMT</pubDate>
            <atom:updated>2014-10-21T22:38:08.424Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zoFzdvMb58pAjK3DhdgcjA.png" /></figure><h3>Haml: form &amp;&amp; function</h3><p>What is <a href="http://haml.info/">Haml</a>? you ask. To the extent I’ve been using it, it’s a way to write out HTML and Ruby’s ERB, in a much more concise manner. The folks who created it define it as a “HTML <em>abstraction</em> markup language,” and it certainly did feel abstract my first go around with it, though not so abstract as to create any barriers to stop me from fully adopting it.</p><p>Haml is indentation sensitive. That is to say, all those tabs affect what your output will render. This may throw you a bit at first, but if you’re already formatting your code properly, then the spacing requirements that Haml enforces on you are moot.</p><p>Proper formatting of code is highly praised because it allows for a quicker and easier way to identify errors and discrepancies. Your code feels unbalanced if there’s a missing closing tag or if a colon is amiss from a run of symbols. If you’re putting the effort into such a practice, you may as well reap the rewards for all those non home row tab key strokes you’re making anyhow. Haml has essentially stolen the inherent functionality of elements like closing tags and given it to the tab key instead. A key we’re using religiously regardless of the fact that it doesn’t have a real effect on our codebase. It’s kinda like getting paid extra for doing some something you were already doing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*kv1jWDBhhWIPJ1BN9g17tw.png" /><figcaption>Your basic Bootstrap jumbotron body, with the three info boxes being dynamically generated though Rails, written in Haml.</figcaption></figure><p>So closing tags are gone. Opening tags are down to just a `%` sign. Classes are now called with just a `.` and in many cases stand alone and almost entirely eliminate the need for div tags altogether. The div tag, a tag that once littered my HTML files and is now on some sort of code based endangered species list. It’s gotten quite enjoyable to pull over snippets of HTML code from here and there and just start stripping them down. It’s also great practice for figuring out the semantics of Haml’s markup. Sure there are times when it’ll throw you for a loop, but at the very worst you just write it out in standard HTML and drop it in a <a href="http://html2haml.heroku.com/">Haml converter</a> to see where you were off base.</p><p>Aside from its functionality, it produces a much more attractive screen of code. If you’re having a hard time seeing the forest for the trees in your HTML files, give Haml a try.</p><p><a href="http://haml.info/tutorial.html">Great tutorial for getting stated with Haml.</a></p><p><a href="http://haml.info/docs/yardoc/file.REFERENCE.html">Haml documentation for a bit more in depth reading.</a></p><blockquote><em>I am currently a student of </em><a href="http://www.galvanize.it/school/#main"><em>gSchool</em></a><em> in Boulder. Feel free to reach out to me on Twitter to chat more about Haml: </em><a href="https://twitter.com/MrJadaml">@MrJadaml</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed9d38af5bbf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gschool-chronicles/what-is-haml-you-ask-to-the-extent-ive-been-using-it-its-a-way-to-write-out-html-and-rubys-html-ed9d38af5bbf">What is HAML you ask? To the extent I’ve been using it it’s a way to write out HTML and Ruby’s HTML…</a> was originally published in <a href="https://medium.com/gschool-chronicles">gSchool Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[First things first]]></title>
            <link>https://medium.com/code-for-denver-ruby/first-things-first-c0f1c0dd6c32?source=rss-649a3b0beac7------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0f1c0dd6c32</guid>
            <dc:creator><![CDATA[Jadam]]></dc:creator>
            <pubDate>Sat, 17 May 2014 16:28:57 GMT</pubDate>
            <atom:updated>2014-05-17T16:28:57.091Z</atom:updated>
            <content:encoded><![CDATA[<h4>Setting up Ruby &amp; Rails environments!</h4><p>Before you can jump into programing anything you’ll want to get a few things squared away. If you’re new to programing this first bit may seem a bit overwhelming but don’t fret, it’s acutally easier than it appears. There are a lot of tutorials and books that can get you going and everyone has their preference and ours is <a href="http://installrails.com/">InstallRails.com</a>. It does a great job navigating the messy detials of operating systems and versions to get you to easy to follow instructions specific for whatever your setup may be. Also the pretty colors are a plesent distraction from how intimidating this initial process feels to many.</p><p>We’d love to get feedback about which tutorials you found the easiest or hardest to work with and any bugs you ran into along the way so that we can keep this post up to date with the best options.</p><p>Should you run into any issues setting up through installrails.com try one of these:</p><p><a href="http://ruby.learncodethehardway.org/book/ex0.html">Learn Rails the Hard Way — Setup</a></p><p><a href="http://tutorials.jumpstartlab.com/topics/environment/environment.html">Jumpstart Lab</a></p><p><a href="http://railsinstaller.org/">RubyInstaller.org</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0f1c0dd6c32" width="1" height="1" alt=""><hr><p><a href="https://medium.com/code-for-denver-ruby/first-things-first-c0f1c0dd6c32">First things first</a> was originally published in <a href="https://medium.com/code-for-denver-ruby">Ruby on Rails::Basics</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Instagram doesn’t get UX]]></title>
            <link>https://medium.com/@MrJadaml/instagram-doesnt-get-ux-8605eb34663?source=rss-649a3b0beac7------2</link>
            <guid isPermaLink="false">https://medium.com/p/8605eb34663</guid>
            <dc:creator><![CDATA[Jadam]]></dc:creator>
            <pubDate>Sun, 02 Mar 2014 21:32:01 GMT</pubDate>
            <atom:updated>2014-03-02T22:06:37.285Z</atom:updated>
            <content:encoded><![CDATA[<h4>40+ clicks too many: where as only 4  on Twitter.</h4><p>To switch from my @DenverStreetArt account to my personal account <em>and back</em> to my @DenverStreetArt account on Twitter takes a total of 4 clicks.</p><p>To do the same on Instagram requires <strong>over</strong> 45 clicks, given that you need to enter in user names and passwords and a few other commands.</p><p>In addition, every time you log out, Instagram also clears your cashe of previously used hashtags and user mentions (ones you don’t follow). Less of an issue on my personal account, but creates redundant work and increases the likelihood of a mistake after I return to my @DenverStreetArt account. I’ll have to dive out-of-screen to pull-up, verify, and find pertinent information I’d previously gathered and used. Information that would’ve otherwise been autopopulated in a queue after typing in a couple characters. As a result, I’ve both inadvertently misspelled someones handle and my own hashtag before. Information that should’ve just appeared in a list for me to pick out. An issue only compounded by my dyslexia — there’s a reason I’m more of a visual person.</p><p>It’s annoying and embarasing when it happens, and has resulted in the abandonment of my personal account. I recently posted on it for the first time in over two months and two-and-a-half months was my post prior to that. This qualifies me as an “inactive user” for those all-important social media platform stats that get spouted out each month.</p><p>So, Instagram, for your benifit and mine, as I take photos that I’d like to post on my personal account, please function a bit more like Twitter in reguards to swapping between accounts.</p><p>While you’re at it, will you (Facebook) just makeup with Twitter already. It does everyone a disservice when shared Instagram posts end up on Twitter <a href="http://techcrunch.com/2012/12/09/it-appears-that-instagram-photos-arent-showing-up-in-twitter-streams-at-all/">as a link</a> rather than a photo. Purposly withholding useful funtionality makes you look petty.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8605eb34663" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Concerns Over Today’s Journalism]]></title>
            <link>https://medium.com/@MrJadaml/concerns-over-todays-journalism-6a9f70ee4565?source=rss-649a3b0beac7------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a9f70ee4565</guid>
            <dc:creator><![CDATA[Jadam]]></dc:creator>
            <pubDate>Tue, 14 Jan 2014 18:35:25 GMT</pubDate>
            <atom:updated>2014-01-14T18:35:25.269Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Response to Aaron Sorkin</h4><p>Recently Aaron Sorkin stated, in regards to journalism today, that “We are becoming more and more entertained by other people falling down. It&#39;s cheap. It&#39;s easy&quot;</p><p>I agree with Sorkin, and while no single answer is the sole reason why this is probably the case, I have my opinions:</p><p>The media targets negative stories over positive ones, because, sadly, Shock &amp; Dismay drives more traffic than Inspiring &amp; Wonderful. As the consumers of this content, we’re the ones voting for what they present with every click and view.</p><p>Why do we do this? It requires much less work to get a boost to our self-esteem if we can watch someone act to a lower degree than us compared to seeing a success and using it as inspiration to create our own.</p><p>This negative media problem has become more prevalent in recent years. I would love nothing more than to see inspiring images grace our TV screens again, like when JFK announced, with great conviction, our plan to go to the moon.</p><p>“We choose to go to the moon in this decade and do the other things, not because they are easy, but because they are hard, because that goal will serve to organize and measure the best of our energies and skills, because that challenge is one that we are willing to accept, one we are unwilling to postpone, and one which we intend to win, and the others, too”</p><p>We have it in ourselves to do the hard things, to “do the other things,” and it would be great if big media would be proponents and instigators to such endeavors rather than catering to the lowest common denominator.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a9f70ee4565" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>