Created
June 13, 2012 19:03
-
-
Save notesolution/2925811 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
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