Created
March 31, 2010 18:36
-
-
Save durran/350697 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class InterventionsController < ApplicationController | |
inherit_resources | |
actions :create, :update, :edit, :new | |
nested_belongs_to :patient, :drug_therapy_problem | |
create! do |success, failure| | |
success.html do | |
@intervention.activate!("Manual communication") | |
end | |
failure.html { render :action => 'new', :status => :unprocessable_entity } | |
end | |
protected | |
def build_resource | |
@intervention ||= end_of_association_chain.build(params[:intervention] || {}) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment