02 Jan '14, 9pm

Using Polymorphism to Make a Better Activity Feed in Rails

Using Polymorphism to Make a Better Activity Feed in Rails Dan Croak December 02, 2013 rails You won't find "polymorphic partials" in Rails' API documentation. However, the general programming technique of polymorphism can be applied to Rails partials. Example: an activity feed for an eBay marketplace Imagine you are signed into an application similar to eBay. You can buy or sell items on the marketplace. In order to buy an item, you need to bid on it. You see an activity feed that includes bids, comments, and other things that are relevant to you. Models We'll use a polymorphic association : class Activity < ActiveRecord::Base belongs_to :subject, polymorphic: true belongs_to :user end When subjects like Bid s and Comment s are created, we'll create Activity records that both the seller and bidder will see in their activity feeds. class Bid < ActiveRecord::Base belongs_to...

Full article: http://robots.thoughtbot.com/using-polymorphism-to-make-a...

Tweets

We still need a couple more sponsors to make @l...

larubyconf.com 09 Jan '14, 9pm

With out the continued support of the companies below the Los Angeles Ruby Conference would not be the quality it is today...

Buenísimo video para relaciones “has_and_belong...

railscasts.com 03 Jan '14, 6pm

It is often asked: how do I create a list of checkboxes for managing a HABTM association? Ask no more because this episode...

Rendering Collections in Rails

robots.thoughtbot.com 31 Dec '13, 10pm

Rendering Collections in Rails Joël Quenneville December 31, 2013 rails Partials are a great way to break down complex vie...

7 Ways to Make Golf Better in 2014, according to @bcarney68

7 Ways to Make Golf Better in 2014, according t...

golfwrx.com 03 Jan '14, 11pm

is an earnest, plain-speaking Midwesterner who brought light and, okay, a lot of heat, to the golf conversation this year....

Unable to find Ruby on Rails developers to hire in New York? We love working with NY clients. Get in touch!

Unable to find Ruby on Rails developers to hire...

planetargon.com 02 Jan '14, 6pm

Our team is always looking to help businesses and organizations succeed with their web projects. If you’re in New York and...

Dang, Array#to_sentence in rails defaults to us...

apidock.com 02 Jan '14, 11pm

Converts the array to a comma-separated sentence where the last element is joined by the connector word. Options: :words_c...

Seven New Year's resolutions to make your neighborhood a better place

Seven New Year's resolutions to make your neigh...

grist.org 01 Jan '14, 5pm

Photo: LOLren I don’t know about you, but the prospect of trying to improve myself every damn New Year is daunting. I’m no...

Oh, How Pinteresting!, Freshening up your home feed with related Pins:

Oh, How Pinteresting!, Freshening up your home ...

blog.pinterest.com 30 Dec '13, 6pm

One of the things we hear from Pinners (like you!) is that it sometimes takes some work to find fresh Pins you love. To ma...

TDD and ActiveRecord in Rails

rubyflow.com 06 Jan '14, 4pm

TDD and ActiveRecord in Rails Posted by solnic on January 06, 2014 — 0 comments Check out my thoughts on TDDing ActiveReco...

Here's the method that hands over an authentici...

api.rubyonrails.org 13 Jan '14, 3am

Controller actions are protected from Cross-Site Request Forgery (CSRF) attacks by including a token in the rendered html ...

Feed Your Libido With Almonds

Feed Your Libido With Almonds

pursuitist.com 05 Jan '14, 9pm

Almonds are full of essential fatty acids that help keep your hormones at balanced levels. Any type of nut for that matter...

Handling large file uploads - Controllers & Vie...

railsforum.com 01 Jan '14, 11pm

I have a webapp that allows users to upload video files. These files vary in size, but some may be as large as 4GB. The pr...

RubyMine 6 for component-based Ruby and Rails applications

RubyMine 6 for component-based Ruby and Rails a...

pivotallabs.com 02 Jan '14, 10pm

I have previously written about how to use IntelliJ to set up multi-project support in RubyMine . I am happy to say that t...

Who wants to reboot the Rails Podcast? It's bee...

podcast.rubyonrails.org 02 Jan '14, 7pm

John Medina on Brain Rules for Baby, Part II Friday, October 15, 2010 Download: MP3 18.1 MB | MP4 27.2 MB Popular brain re...

Better Wall Design?

greenbuildingadvisor.com 06 Jan '14, 1am

I have a question about a wall design I haven't seen before. What if we took 2x6 top and bottom plates with 2 - 2x4 studs ...