Skip to content

Instantly share code, notes, and snippets.

@notesolution
Created June 13, 2012 19:03
Show Gist options
  • Save notesolution/2925811 to your computer and use it in GitHub Desktop.
Save notesolution/2925811 to your computer and use it in GitHub Desktop.
def create
attrs = params[:group_question]
group_id = params[:group_id]
if @group = Group.find group_id
@question = _user.group_question group, attrs
@result = @question.errors.messages.map{|k,v| "#{v[0]}<br/>" } unless @question.save
end
json_only_action
end
# This should be an after_create callback for question
_user.deliver_group_question @question if @question.group.instructor_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment