{"id":825,"date":"2014-06-09T08:00:46","date_gmt":"2014-06-09T07:00:46","guid":{"rendered":"http:\/\/www.diogonunes.com\/blog\/?p=825"},"modified":"2020-05-15T14:24:43","modified_gmt":"2020-05-15T13:24:43","slug":"bootstrap-switch-on-rails","status":"publish","type":"post","link":"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/","title":{"rendered":"Using Bootstrap Switch 3 on Rails"},"content":{"rendered":"<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2014\/06\/bootstrap-switch-3-demo-examples.png?resize=564%2C430\" alt=\"bootstrap switch 3 demo examples\" width=\"564\" height=\"430\" class=\"aligncenter size-full wp-image-1363\" srcset=\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2014\/06\/bootstrap-switch-3-demo-examples.png?w=564&amp;ssl=1 564w, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2014\/06\/bootstrap-switch-3-demo-examples.png?resize=400%2C304&amp;ssl=1 400w\" sizes=\"auto, (max-width: 564px) 100vw, 564px\" \/><\/p>\n<h3>Replace Bootstrap&#8217;s checkboxes and radio buttons by an elegant switch&#8230; a Bootstrap Switch.<\/h3>\n<p><!--more--><\/p>\n<p>I&#8217;m a great fan of <a href=\"http:\/\/getbootstrap.com\/\">Twitter&#8217;s Bootstrap<\/a>. Recently I had to develop a settings page which involved displaying a lot of Yes\/No checkboxes. It looked outdated. <strong>I wanted something a bit more &#8220;app-like&#8221; &#8211; a Yes\/No switch<\/strong>. However <strong>Bootstrap does not include one<\/strong>, so I found an <a href=\"http:\/\/www.bootstrap-switch.org\/\">open-source bootstrap-themed switch<\/a>. The contributors are amazing: I use Bootstrap Switch since version 2 and when Bootstrap 3 came out I requested a visual update so that the switch looked coherent with Bootstrap 3 &#8211; a couple of weeks later my request was fulfilled!<\/p>\n<p>How can you use this Bootstrap Switch with Ruby on Rails? Well <a href=\"http:\/\/stackoverflow.com\/questions\/22883904\/using-bootstrap-switch-with-rails-check-box\">it was not that simple<\/a> so <strong>here goes how I managed to make it work<\/strong>. By the way, using Bootstrap Switch 3 does not force you to use version 3 of Twitter Bootstrap; I tested it with Bootstrap 2 and it worked perfectly.<\/p>\n<h3>Set up<\/h3>\n<ul>\n<li>Add <code>gem 'bootstrap-switch-rails', '~&gt; 3.0.0'<\/code> to your <code>Gemfile<\/code><\/li>\n<li>Add <code>\/\/= require bootstrap-switch<\/code> to <code>\/assets\/javascripts\/application.js<\/code><\/li>\n<li>Add <code>*= require bootstrap3-switch<\/code> to <code>\/assets\/stylesheets\/application.css<\/code><\/li>\n<\/ul>\n<p>If you use SASS, add <code>@import \"bootstrap3-switch\";<\/code> to the top of your css file that contains your custom css styles (mine is <code>app\/assets\/stylesheets\/custom.css.scss<\/code>)<\/p>\n<h3>Use it<\/h3>\n<p>Every view (<code>*.html.erb<\/code>) that has a Bootstrap Switch needs a bit of Javascript for the switch to work. Since you want the switch to display correctly as soon as the webpage is loaded, I recommend that you put the JS code on the page&#8217;s header (instead of the footer, as I usually do with JS code that runs on background). The Rails code for that:<\/p>\n<pre><code>&lt;% content_for :head do %&gt;\n  &lt;script type=\"text\/javascript\"&gt;\n  $(document).ready(function() {\n    $('input:checkbox').bootstrapSwitch();\n  });\n  &lt;\/script&gt;\n&lt;% end %&gt;\n<\/code><\/pre>\n<p>Notice that <code>$('input:checkbox').bootstrapSwitch();<\/code> will affect ALL checkboxes on that page. If you want more control you can specify the checkbox id, like so <code>$(\"[name='my-checkbox-id']\").bootstrapSwitch();<\/code>. Don&#8217;t forget to add that same id to your checkbox.<\/p>\n<p>To display the switch on a form together associated with a field just:<\/p>\n<pre><code>&lt;%= f.label :field_name, \"Field Description\" %&gt;\n&lt;%= f.check_box :field_name %&gt;\n<\/code><\/pre>\n<p>That will display the default switch. If you want to <strong>customize the switch<\/strong> you just need to edit the second line. For instance, I wanted to display a Yes\/No switch, with the Yes option on green (Bootstrap&#8217;s <code>success<\/code> class), and a bit smaller than the default size. The code for that customization is below:<\/p>\n<pre><code>&lt;%= f.check_box :field_name,\n    :data =&gt; { :size=&gt;'small', 'on-color'=&gt;'success', 'on-text'=&gt;'YES', 'off-text'=&gt;'NO' } %&gt;\n<\/code><\/pre>\n<p>Examples <a href=\"http:\/\/www.jque.re\/plugins\/version3\/bootstrap.switch\/\">here<\/a>, and interactive examples <a href=\"http:\/\/www.bootply.com\/92189#\">here<\/a>.<\/p>\n<p>Don&#8217;t forget to <a href=\"https:\/\/github.com\/nostalgiaz\/bootstrap-switch\/\">thank the developers by giving the project a star on github<\/a> ;)<\/p>\n<hr \/>\n","protected":false},"excerpt":{"rendered":"<p>Replace Bootstrap&#8217;s checkboxes and radio buttons by an elegant switch&#8230; a Bootstrap Switch.<\/p>\n","protected":false},"author":1,"featured_media":1363,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2],"tags":[30,31,48],"class_list":["post-825","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech","tag-ruby-on-rails","tag-tutorial","tag-web-dev"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Using Bootstrap Switch 3 on Rails - The Geeky Gecko<\/title>\n<meta name=\"description\" content=\"Replace Bootstrap&#039;s checkboxes and radio buttons by an elegant switch... a Bootstrap Switch.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using Bootstrap Switch 3 on Rails - The Geeky Gecko\" \/>\n<meta property=\"og:description\" content=\"Replace Bootstrap&#039;s checkboxes and radio buttons by an elegant switch... a Bootstrap Switch.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/\" \/>\n<meta property=\"og:site_name\" content=\"The Geeky Gecko\" \/>\n<meta property=\"article:published_time\" content=\"2014-06-09T07:00:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-05-15T13:24:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2014\/06\/bootstrap-switch-3-demo-examples.png?fit=564%2C430&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"564\" \/>\n\t<meta property=\"og:image:height\" content=\"430\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Diogo Nunes\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@dialexnunes\" \/>\n<meta name=\"twitter:site\" content=\"@dialexnunes\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Diogo Nunes\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/\"},\"author\":{\"name\":\"Diogo Nunes\",\"@id\":\"https:\/\/www.diogonunes.com\/blog\/#\/schema\/person\/a6fa79b293f22912664654fcfbd2da0c\"},\"headline\":\"Using Bootstrap Switch 3 on Rails\",\"datePublished\":\"2014-06-09T07:00:46+00:00\",\"dateModified\":\"2020-05-15T13:24:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/\"},\"wordCount\":381,\"publisher\":{\"@id\":\"https:\/\/www.diogonunes.com\/blog\/#\/schema\/person\/a6fa79b293f22912664654fcfbd2da0c\"},\"image\":{\"@id\":\"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2014\/06\/bootstrap-switch-3-demo-examples.png?fit=564%2C430&ssl=1\",\"keywords\":[\"rails\",\"tutorial\",\"web dev\"],\"articleSection\":[\"Technology\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/\",\"url\":\"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/\",\"name\":\"Using Bootstrap Switch 3 on Rails - The Geeky Gecko\",\"isPartOf\":{\"@id\":\"https:\/\/www.diogonunes.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2014\/06\/bootstrap-switch-3-demo-examples.png?fit=564%2C430&ssl=1\",\"datePublished\":\"2014-06-09T07:00:46+00:00\",\"dateModified\":\"2020-05-15T13:24:43+00:00\",\"description\":\"Replace Bootstrap's checkboxes and radio buttons by an elegant switch... a Bootstrap Switch.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2014\/06\/bootstrap-switch-3-demo-examples.png?fit=564%2C430&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2014\/06\/bootstrap-switch-3-demo-examples.png?fit=564%2C430&ssl=1\",\"width\":564,\"height\":430},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.diogonunes.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using Bootstrap Switch 3 on Rails\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.diogonunes.com\/blog\/#website\",\"url\":\"https:\/\/www.diogonunes.com\/blog\/\",\"name\":\"The Geeky Gecko\",\"description\":\"The Geeky Gecko\",\"publisher\":{\"@id\":\"https:\/\/www.diogonunes.com\/blog\/#\/schema\/person\/a6fa79b293f22912664654fcfbd2da0c\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.diogonunes.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.diogonunes.com\/blog\/#\/schema\/person\/a6fa79b293f22912664654fcfbd2da0c\",\"name\":\"Diogo Nunes\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.diogonunes.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2026\/04\/Geeky-Gecko-2026-v2.png?fit=799%2C799&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2026\/04\/Geeky-Gecko-2026-v2.png?fit=799%2C799&ssl=1\",\"width\":799,\"height\":799,\"caption\":\"Diogo Nunes\"},\"logo\":{\"@id\":\"https:\/\/www.diogonunes.com\/blog\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/www.diogonunes.com\",\"https:\/\/x.com\/dialexnunes\"],\"url\":\"https:\/\/www.diogonunes.com\/blog\/author\/diogo-nunes\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using Bootstrap Switch 3 on Rails - The Geeky Gecko","description":"Replace Bootstrap's checkboxes and radio buttons by an elegant switch... a Bootstrap Switch.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/","og_locale":"en_US","og_type":"article","og_title":"Using Bootstrap Switch 3 on Rails - The Geeky Gecko","og_description":"Replace Bootstrap's checkboxes and radio buttons by an elegant switch... a Bootstrap Switch.","og_url":"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/","og_site_name":"The Geeky Gecko","article_published_time":"2014-06-09T07:00:46+00:00","article_modified_time":"2020-05-15T13:24:43+00:00","og_image":[{"width":564,"height":430,"url":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2014\/06\/bootstrap-switch-3-demo-examples.png?fit=564%2C430&ssl=1","type":"image\/png"}],"author":"Diogo Nunes","twitter_card":"summary_large_image","twitter_creator":"@dialexnunes","twitter_site":"@dialexnunes","twitter_misc":{"Written by":"Diogo Nunes","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/#article","isPartOf":{"@id":"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/"},"author":{"name":"Diogo Nunes","@id":"https:\/\/www.diogonunes.com\/blog\/#\/schema\/person\/a6fa79b293f22912664654fcfbd2da0c"},"headline":"Using Bootstrap Switch 3 on Rails","datePublished":"2014-06-09T07:00:46+00:00","dateModified":"2020-05-15T13:24:43+00:00","mainEntityOfPage":{"@id":"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/"},"wordCount":381,"publisher":{"@id":"https:\/\/www.diogonunes.com\/blog\/#\/schema\/person\/a6fa79b293f22912664654fcfbd2da0c"},"image":{"@id":"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2014\/06\/bootstrap-switch-3-demo-examples.png?fit=564%2C430&ssl=1","keywords":["rails","tutorial","web dev"],"articleSection":["Technology"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/","url":"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/","name":"Using Bootstrap Switch 3 on Rails - The Geeky Gecko","isPartOf":{"@id":"https:\/\/www.diogonunes.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/#primaryimage"},"image":{"@id":"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2014\/06\/bootstrap-switch-3-demo-examples.png?fit=564%2C430&ssl=1","datePublished":"2014-06-09T07:00:46+00:00","dateModified":"2020-05-15T13:24:43+00:00","description":"Replace Bootstrap's checkboxes and radio buttons by an elegant switch... a Bootstrap Switch.","breadcrumb":{"@id":"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/#primaryimage","url":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2014\/06\/bootstrap-switch-3-demo-examples.png?fit=564%2C430&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2014\/06\/bootstrap-switch-3-demo-examples.png?fit=564%2C430&ssl=1","width":564,"height":430},{"@type":"BreadcrumbList","@id":"https:\/\/www.diogonunes.com\/blog\/bootstrap-switch-on-rails\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.diogonunes.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Using Bootstrap Switch 3 on Rails"}]},{"@type":"WebSite","@id":"https:\/\/www.diogonunes.com\/blog\/#website","url":"https:\/\/www.diogonunes.com\/blog\/","name":"The Geeky Gecko","description":"The Geeky Gecko","publisher":{"@id":"https:\/\/www.diogonunes.com\/blog\/#\/schema\/person\/a6fa79b293f22912664654fcfbd2da0c"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.diogonunes.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.diogonunes.com\/blog\/#\/schema\/person\/a6fa79b293f22912664654fcfbd2da0c","name":"Diogo Nunes","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.diogonunes.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2026\/04\/Geeky-Gecko-2026-v2.png?fit=799%2C799&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2026\/04\/Geeky-Gecko-2026-v2.png?fit=799%2C799&ssl=1","width":799,"height":799,"caption":"Diogo Nunes"},"logo":{"@id":"https:\/\/www.diogonunes.com\/blog\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/www.diogonunes.com","https:\/\/x.com\/dialexnunes"],"url":"https:\/\/www.diogonunes.com\/blog\/author\/diogo-nunes\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2014\/06\/bootstrap-switch-3-demo-examples.png?fit=564%2C430&ssl=1","jetpack-related-posts":[{"id":665,"url":"https:\/\/www.diogonunes.com\/blog\/ruby-on-rails-an-overview-on-why-its-so-good\/","url_meta":{"origin":825,"position":0},"title":"Ruby on Rails: an overview on why it&#8217;s so good","author":"Diogo Nunes","date":"5 May, 2014","format":false,"excerpt":"I was in denial for a while but now I get why Rails is so good. First things first, what is Rails anyway? Ruby on Rails is a framework that allows you to develop web applications using the MVC design pattern. Generally speaking a framework is a higher-level abstraction that\u2026","rel":"","context":"In &quot;Technology&quot;","block_context":{"text":"Technology","link":"https:\/\/www.diogonunes.com\/blog\/category\/tech\/"},"img":{"alt_text":"www.tryruby.org","src":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2014\/05\/try-ruby-e1373488411601.jpg?fit=500%2C375&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":4453,"url":"https:\/\/www.diogonunes.com\/blog\/playwright-cheat-sheet\/","url_meta":{"origin":825,"position":1},"title":"Playwright cheat sheet","author":"Diogo Nunes","date":"7 February, 2022","format":false,"excerpt":"\u2b50\ufe0f This post was featured in Software Testing Weekly #110 and Coding JAG #76 My first experience with Playwright was terrible. However the testing community seems to be loving it, thus I gave it another shot. I started by doing a free course, but I don't recommend it, it's very\u2026","rel":"","context":"In &quot;Technology&quot;","block_context":{"text":"Technology","link":"https:\/\/www.diogonunes.com\/blog\/category\/tech\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2021\/11\/patrick-tomasso-Oaqk7qqNh_c-unsplash.jpg?fit=1200%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2021\/11\/patrick-tomasso-Oaqk7qqNh_c-unsplash.jpg?fit=1200%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2021\/11\/patrick-tomasso-Oaqk7qqNh_c-unsplash.jpg?fit=1200%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2021\/11\/patrick-tomasso-Oaqk7qqNh_c-unsplash.jpg?fit=1200%2C800&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2021\/11\/patrick-tomasso-Oaqk7qqNh_c-unsplash.jpg?fit=1200%2C800&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":379,"url":"https:\/\/www.diogonunes.com\/blog\/set-up-your-rails-env\/","url_meta":{"origin":825,"position":2},"title":"Setting up your Rails environment from scratch","author":"Diogo Nunes","date":"12 May, 2014","format":false,"excerpt":"This is a complete yet summarized guide to set up a Ruby on Rails development environment on Linux. Installing and configuring Sublime Text, Github, and Heroku are optional but we're included for the sake of completeness. Since these are the de facto tools for editing source code, managing code repositories\u2026","rel":"","context":"In &quot;Technology&quot;","block_context":{"text":"Technology","link":"https:\/\/www.diogonunes.com\/blog\/category\/tech\/"},"img":{"alt_text":"original photo: goo.gl\/QE43FV","src":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2014\/05\/rails-worker-assembly-construction.jpg?fit=620%2C230&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2014\/05\/rails-worker-assembly-construction.jpg?fit=620%2C230&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2014\/05\/rails-worker-assembly-construction.jpg?fit=620%2C230&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":1481,"url":"https:\/\/www.diogonunes.com\/blog\/custom-domain-for-rails-application-at-heroku\/","url_meta":{"origin":825,"position":3},"title":"Using a custom domain for your (Rails) application at Heroku","author":"Diogo Nunes","date":"3 November, 2014","format":false,"excerpt":"Because no one will remember gentle-tundra-5348.herokuapp.com If you deployed your Rails application to heroku for free, you probably ended up with an URL like http:\/\/weird-name-1234.herokuapp.com\/. You can rename that URL to something more familiar, but it will always be of the form *.heroku.com. That's fine when your just testing or\u2026","rel":"","context":"In &quot;Technology&quot;","block_context":{"text":"Technology","link":"https:\/\/www.diogonunes.com\/blog\/category\/tech\/"},"img":{"alt_text":"original photo: http:\/\/goo.gl\/dxaV95","src":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2014\/11\/Heroku-Rails-Station.jpg?fit=600%2C400&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2014\/11\/Heroku-Rails-Station.jpg?fit=600%2C400&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2014\/11\/Heroku-Rails-Station.jpg?fit=600%2C400&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":671,"url":"https:\/\/www.diogonunes.com\/blog\/rails-vs-django-vs-play-frameworks\/","url_meta":{"origin":825,"position":4},"title":"Rails vs Django vs Play: Battle of frameworks","author":"Diogo Nunes","date":"26 May, 2014","format":false,"excerpt":"This post is a review of those three frameworks considering four criteria: Ease of learning, Speed of development, Tools\/Plugins, and Community. Right from the start I banished PHP from my possible choices. I know that \"sufficiently talented coders can write great applications in terrible languages\" (Jeff Atwood), but I just\u2026","rel":"","context":"In &quot;Technology&quot;","block_context":{"text":"Technology","link":"https:\/\/www.diogonunes.com\/blog\/category\/tech\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2014\/09\/rails-vs-django-vs-play.jpg?fit=946%2C550&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2014\/09\/rails-vs-django-vs-play.jpg?fit=946%2C550&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2014\/09\/rails-vs-django-vs-play.jpg?fit=946%2C550&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2014\/09\/rails-vs-django-vs-play.jpg?fit=946%2C550&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":3055,"url":"https:\/\/www.diogonunes.com\/blog\/your-attention-please\/","url_meta":{"origin":825,"position":5},"title":"Your attention (please!)","author":"Diogo Nunes","date":"5 June, 2017","format":false,"excerpt":"Don't babysit grown-ups. This might sound like a lapalissade but people crave for your attention. We live in a world of full of calls to listen\/action (ads, social media, etc.) from brands and organizations. But for those, you can click a button or flick a switch and all that noise\u2026","rel":"","context":"In &quot;Thoughts&quot;","block_context":{"text":"Thoughts","link":"https:\/\/www.diogonunes.com\/blog\/category\/thoughts\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2017\/05\/navi_says_hey_listen__by_aspergersgirl-d5nrcl6.png?fit=900%2C723&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2017\/05\/navi_says_hey_listen__by_aspergersgirl-d5nrcl6.png?fit=900%2C723&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2017\/05\/navi_says_hey_listen__by_aspergersgirl-d5nrcl6.png?fit=900%2C723&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.diogonunes.com\/blog\/wp-content\/uploads\/2017\/05\/navi_says_hey_listen__by_aspergersgirl-d5nrcl6.png?fit=900%2C723&ssl=1&resize=700%2C400 2x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.diogonunes.com\/blog\/wp-json\/wp\/v2\/posts\/825","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.diogonunes.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.diogonunes.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.diogonunes.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.diogonunes.com\/blog\/wp-json\/wp\/v2\/comments?post=825"}],"version-history":[{"count":1,"href":"https:\/\/www.diogonunes.com\/blog\/wp-json\/wp\/v2\/posts\/825\/revisions"}],"predecessor-version":[{"id":3835,"href":"https:\/\/www.diogonunes.com\/blog\/wp-json\/wp\/v2\/posts\/825\/revisions\/3835"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.diogonunes.com\/blog\/wp-json\/wp\/v2\/media\/1363"}],"wp:attachment":[{"href":"https:\/\/www.diogonunes.com\/blog\/wp-json\/wp\/v2\/media?parent=825"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.diogonunes.com\/blog\/wp-json\/wp\/v2\/categories?post=825"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.diogonunes.com\/blog\/wp-json\/wp\/v2\/tags?post=825"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}