railscasts.com Archives - 07 December 2012, Friday

  • #395 Action Controller Walkthrough (pro)

    railscasts.com 03 Dec '12, 8am

    #395 Action Controller Walkthrough pro Dec 02, 2012 | 11 minutes | Controllers , Rack Do you ever wonder what goes on behind the scenes when a Rails controller handles a request? What do the "render" and "redirect_to" methods do exactly? This and more covered as we walk through the co...

  • #162 Tree-Based Navigation (revised)

    railscasts.com 02 Dec '12, 12am

    #162 Tree-Based Navigation (revised) Dec 01, 2012 | 10 minutes | Active Record , Plugins , Views If your Rails app is content-heavy, consider organizing it in a tree menu structure. Here I show how to add top-level tabs, nested links in a side bar, and breadcrumbs to go up the hierarc...

  • #394 STI and Polymorphic Associations (pro)

    railscasts.com 26 Nov '12, 4am

    #394 STI and Polymorphic Associations Nov 25, 2012 | 14 minutes | Refactoring , Active Record Single Table Inheritance (STI) can help organize branching logic into separate classes, but a polymorphic association may be a better fit if there are unique database columns. Subscribe to Wa...

  • #236 OmniAuth Part 2

    railscasts.com 24 Nov '12, 2am

    Unfortunately there is no easy solution to this problem. What we’ll do is keep the validation and redirect the user to a form where they can fix any problems if the validation fails when we try to save the new user. We’ll change the code in create so that if the validation fails when ...

  • #387 Cache Digests

    railscasts.com 23 Nov '12, 6pm

    Even though this has worked it’s annoying to have to remember to make this change every time we change a template and this is where the Cache Digests gem comes in useful. This functionality will be available by default in Rails 4 but has been extracted out into a gem so that we can us...

  • #393 Guest User Record

    railscasts.com 22 Nov '12, 2am

    Instead of presenting a sign up form to the user, consider creating a temporary guest record so the user can try out the application without filling in their information up front. They can then become a permanent member afterwards.

  • #392 A Tour of State Machines (pro)

    railscasts.com 17 Nov '12, 7pm

    #392 A Tour of State Machines Nov 17, 2012 | 12 minutes | Plugins , Active Record , Testing Here I show how three popular state machine gems can be used to clean up a list of boolean/datetime fields. I also show a custom solution which keeps track of the history of events. Subscribe t...

  • #103 Site-Wide Announcements (revised)

    railscasts.com 12 Nov '12, 7pm

    #103 Site-Wide Announcements (revised) Nov 12, 2012 | 11 minutes | Active Record , Ajax , Testing Here I show how to add an announcement message at the top of every page in the application and allow the user to permanently hide it. This is all done test-first and even includes testing...

  • #384 Exploring RubyGems

    railscasts.com 11 Nov '12, 9am

    RubyGems can make it easy to add a feature to a Rails application, but it can also cause headaches down the road. Here I give some tips on researching gems to decide which one to choose, or when to do it from scratch.

    Related:
    1. #370 Ransack railscasts.com 10 Nov '12, 3pm
  • ASCIIcast 370 - Ransack (日本語): #railscasts #asciicasts #free

    #370 Ransack

    railscasts.com 10 Nov '12, 3pm

    Ransack allows you to easily build complex search forms. It also helps in adding sortable links and building a dynamic advanced search page.

    Related:
    1. #384 Exploring RubyGems railscasts.com 11 Nov '12, 9am
  • #391 Testing JavaScript with PhantomJS (pro)

    railscasts.com 08 Nov '12, 3am

    PhantomJS allows us to test JavaScript without going through a browser window. Here I show how to do this using Capybara and Poltergeist. I also give some tips on handling database transactions and skipping javascript tests.

  • #390 Turbolinks

    railscasts.com 05 Nov '12, 10pm

    Turbolinks can make your Rails app feel faster by using JavaScript to replace the page content when clicking a link. It will be default in new Rails 4.0 applications, but here I show how to use it in Rails 3 and mention some of the gotchas.

  • Announcement

    railscasts.com 05 Nov '12, 2am

    This past week's topics are on Turbolinks and PhantomJS. I ran into some challenges with these topics which has delayed them into this week. The good news is I'm done recording the Turbolinks episode and will be releasing it tomorrow (Monday). I expect to have the PhantomJS episode up...

  • #241 Simple OmniAuth

    railscasts.com 04 Nov '12, 3am

    Some things have changed since OmniAuth version 1.0 was released. Each provider is now a separate gem that should be included in the Gemfile, and the "user_info" hash is now simply "info". The changes have been made below.

  • #147 Sortable Lists (revised)

    railscasts.com 03 Nov '12, 11pm

    This libarary is written using ARel from the ground-up. This leaves the code much cleaner than many implementations. ranked-model is also optimized to write to the database as little as possible: ranks are stored as a number between -8388607 and 8388607 (the MEDIUMINT range in MySQL)....

  • #106 Time Zones (revised)

    railscasts.com 29 Oct '12, 5am

    #106 Time Zones (revised) Oct 28, 2012 | 7 minutes | Active Support Active Support makes it easy to work with time zones. Learn how to add a Time Zone select field to a user form and watch out for the gotchas. Subscribe to Watch Episode Tweet Show Notes 2 Comments Similar Episodes < P...

    Related:
    1. #136 jQuery & Ajax (revised) railscasts.com 28 Oct '12, 9pm
  • #136 jQuery & Ajax (revised)

    railscasts.com 28 Oct '12, 9pm

    Here I go back to the basics and show how to turn a traditional Rails app into one that interacts through Ajax by adding "remote" options, JavaScript templates and a dabble of jQuery.

    Related:
    1. #106 Time Zones (revised) railscasts.com 29 Oct '12, 5am
  • #372 Bullet

    railscasts.com 28 Oct '12, 6am

    Category Load (0.2ms) SELECT "categories".* FROM "categories" ORDER BY name Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = 3 Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."category_id" = 1 Product Load (0.2ms) SELE...

  • #389 Multitenancy with PostgreSQL (pro)

    railscasts.com 28 Oct '12, 6am

    #389 Multitenancy with PostgreSQL Oct 27, 2012 | 11 minutes | Active Record , Authorization PostgreSQL Schemas can help create a multi-tenant app by keeping data separate at the database layer. Integrating with migrations can be tricky though, so watch this episode for the full detail...

  • #352 Securing an API

    railscasts.com 25 Oct '12, 2am

    There are many approaches to locking down an API. Here I start off with HTTP Basic authentication then move on to generating a unique token which can be passed through a URL parameter or HTTP header.

  • #382 Tagging

    railscasts.com 21 Oct '12, 9pm

    This migration creates two tables: tags and taggings . We don’t have to create models for these as they’re included with the gem so we can get started with adding tagging to our application. We want an extra field on the page for editing an article where we can add tags for that artic...

  • #388 Multitenancy with Scopes (pro)

    railscasts.com 21 Oct '12, 1am

    #388 Multitenancy with Scopes Oct 20, 2012 | 12 minutes | Active Record , Authorization A multi-tenant application can be difficult to implement because the data for each tenant must be completely separate. Here I show how to do this using subdomains and default scopes in Active Recor...

  • #387 Cache Digests

    railscasts.com 21 Oct '12, 1am

    The cache_digests gem (also included in Rails 4) will automatically add a digest to the fragment cache key based on the template. If a template changes the cache will auto-expire. But watch out for the gotchas!

  • #85 YAML Configuration (revised)

    railscasts.com 15 Oct '12, 5am

    Keeping passwords and secret tokens in source control is a security risk. Here I show how to move these settings out into a YAML configuration file which can be loaded in as a hash or environment variables.

  • #381 jQuery File Upload (pro)

    railscasts.com 14 Oct '12, 9pm

    Here you will learn how to upload multiple files over ajax using jQuery File Upload. I start with the basic functionality and customize it to fit the user interface.

    Related:
    1. File: SASS_REFERENCE sass-lang.com 14 Oct '12, 9am
  • #386 Authorization from Scratch Part 2 (pro)

    railscasts.com 12 Oct '12, 12am

    #386 Authorization from Scratch Part 2 Oct 11, 2012 | 20 minutes | Authorization , Security This finishes the series on building authorization from scratch by refactoring the permission logic into a DSL, restricting authorization with attributes, and combining with strong_parameters t...

  • #192 Authorization with CanCan

    railscasts.com 09 Oct '12, 5am

    we covered Declarative Authorization . While it is an excellent authorization plugin for Rails it can be a little heavy for simpler sites. After writing the Railscast on Declarative Authorization Ryan Bates looked for an alternative solution and, failing to find one that suited his ne...

  • #384 Exploring RubyGems

    railscasts.com 07 Oct '12, 11pm

    RubyGems can make it easy to add a feature to a Rails application, but it can also cause headaches down the road. Here I give some tips on researching gems to decide which one to choose, or when to do it from scratch.

  • #136 jQuery & Ajax (revised)

    railscasts.com 29 Sep '12, 2am

    Here I go back to the basics and show how to turn a traditional Rails app into one that interacts through Ajax by adding "remote" options, JavaScript templates and a dabble of jQuery.

  • #383 Uploading to Amazon S3 (pro)

    railscasts.com 27 Sep '12, 2am

    Here I show how to upload files directly to Amazon S3 using CarrierWave Direct and Fog. I then walk through another project which uses jQuery File Upload to handle multiple files and does not use CarrierWave.