Skip to content

Instantly share code, notes, and snippets.

@mergulhao
Created July 29, 2009 13:20
Show Gist options
  • Save mergulhao/158164 to your computer and use it in GitHub Desktop.
Save mergulhao/158164 to your computer and use it in GitHub Desktop.
def create
if saved = @act.add_participant(@current_person)
flash[:notice] = _('You are now participating in this action!')
else
flash[:notice] = @act.errors.full_messages.first
end
respond_to do |format|
format.html { redirect_to(@act) }
format.xml { head :ok }
format.json { render :json => {:answer => (saved ? 2:1), :message => flash[:notice] }}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment