diff options
| author | mo khan <mo@mokhan.ca> | 2014-07-20 10:14:46 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-07-20 10:14:46 -0600 |
| commit | c2e5237da57312fedc06b801d204fb70bc012d82 (patch) | |
| tree | 0a3938f57662eb13f386d6d2d4431cea3ed8c67a /app/controllers/api/v1 | |
| parent | 8604e242169e1a9e1630fce6de02b7fca8c55856 (diff) | |
save a new tutorial and their tags.
Diffstat (limited to 'app/controllers/api/v1')
| -rw-r--r-- | app/controllers/api/v1/tutorials_controller.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/api/v1/tutorials_controller.rb b/app/controllers/api/v1/tutorials_controller.rb index 589012a5..c257f707 100644 --- a/app/controllers/api/v1/tutorials_controller.rb +++ b/app/controllers/api/v1/tutorials_controller.rb @@ -8,7 +8,9 @@ module Api end def create - respond_with(@tutorial = current_user.tutorials.create!(tutorial_params)) + @tutorial = current_user.tutorials.create!(tutorial_params) + current_user.tag(@tutorial, with: params[:tutorial][:tags], on: :tags) + respond_with(@tutorial) end private |
