Skip to content

Commit

Permalink
add form#response_fields_json method
Browse files Browse the repository at this point in the history
  • Loading branch information
ajb committed Oct 13, 2013
1 parent 21f5b4a commit 40eac07
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/formbuilder/forms_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def update
rf.cid = cids[rf.id]
end

render json: @form.response_fields.to_json(methods: [:field_type, :cid])
render json: @form.response_fields_json
end

private
Expand Down
4 changes: 4 additions & 0 deletions app/models/formbuilder/form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@ def input_fields
response_fields.reject { |rf| !rf.input_field }
end

def response_fields_json
self.response_fields.to_json(methods: [:field_type, :cid])
end

end
end

0 comments on commit 40eac07

Please sign in to comment.