Skip to content

Instantly share code, notes, and snippets.

@eqdw
Created December 16, 2010 20:44
Show Gist options
  • Save eqdw/743983 to your computer and use it in GitHub Desktop.
Save eqdw/743983 to your computer and use it in GitHub Desktop.
class Post < ActiveRecord::Base
has_many :comments
end
class PostController < ApplicationController
def show
@post = Post.find(param[id])
@comments = @post.comments
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment