176985602337900

Find freelancers. Lose those costly delays.

With 1.7 million freelancers, we'll match you with the perfect talent.

or, Register with Elance »

Rails 3.1 Polymorphic Association Code Example
Sign in to Add to Watch List

IT & Programming > Web Programming

View Change History

The client has made the following changes to the job.

Description
Date

Job canceled.

Dec 4, 2011
Close

Job Description

  |  Change History >>

Updated

Close
  • Posted: Sun, Dec 04, 2011
  • Time Left: Closed
  • Location: Anywhere
  • Client prefers freelancers from:
    Anywhere

    You are still able to submit a proposal for this job.

    The client prefers freelancers from
    a different location.

    You're still able to submit a proposal for this job, regardless of your location.
  • Start: Immediately
  • Budget: $40 - $50
  • Fixed Price Job
  • Elance Escrow Protection
  • W9 Not Required
Sign in to view client's details

I'm learning Rails 3.1 and would like a simple, 'least case' working polymorphic code example with forms to help me learn.

Here's my environment that your code example should work under:

Ruby: ruby 1.9.2p290
Rails: Rails 3.1.3

Resources:
rails generate scaffold Companies name:string
rails generate scaffold Contacts first_name:string last_name:string
rails generate scaffold Notes content:text notable_id:integer notable_type:string

After this you simply setup the polymorphic associations, nested resources etc. to show that both Companies and Contacts can have many notes as 'notable.'

That's it really, there are lots of code examples for Rails 2.x but no working ones I can find for Rails 3.1.

To be working properly - both Companies and Contacts show.html.erb should allow note creation via a form that makes the proper association.

So - to you Rails 3.1 experts - this might be the easiest 'cut and paste' money you ever made - but it will help me a lot :)

Sign in or Register to see more

Desired Skills
Ruby on Rails
Job ID: 27407491
Proposals
Avg $ | High $ | Low $ — Show Pricing
  • Submit Date (Latest)
There are no proposals yet.
Sign in to Elance and start working on jobs today.
Sign in to view more of the job details and submit a proposal. Once registered, you'll have access to thousands of jobs online or through email.
Are you ready to post a job like this one?
Post a Similar Job »