Skip to content

Instantly share code, notes, and snippets.

@jameswalton
Created June 10, 2012 19:11
Show Gist options
  • Save jameswalton/2906962 to your computer and use it in GitHub Desktop.
Save jameswalton/2906962 to your computer and use it in GitHub Desktop.
Check controller
class ChecksController < ApplicationController
before_filter :authenticate_user!, :load_task
respond_to :html
def create
@check = @task.checks.build(params[:check])
@check.save
respond_with @check, :location => [@task]
end
private
def load_task
@task = current_user.tasks.find(params[:task_id])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment