Class: MockupsController
- Inherits:
-
ApplicationController
- Object
- ActionController::API
- ApplicationController
- MockupsController
- Defined in:
- app/controllers/mockups_controller.rb
Instance Method Summary (collapse)
Instance Method Details
- (Object) create
16 17 18 19 20 21 |
# File 'app/controllers/mockups_controller.rb', line 16 def create @mockup.project_id = @prototype.project_id @mockup.save @prototype.mockups << @mockup render json: @mockup, status: :created end |
- (Object) destroy
28 29 30 31 |
# File 'app/controllers/mockups_controller.rb', line 28 def destroy @mockup.destroy head :no_content end |
- (Object) index
8 9 10 |
# File 'app/controllers/mockups_controller.rb', line 8 def index render json: @mockups, status: :ok end |
- (Object) show
12 13 14 |
# File 'app/controllers/mockups_controller.rb', line 12 def show render json: @mockup, status: :ok end |
- (Object) update
23 24 25 26 |
# File 'app/controllers/mockups_controller.rb', line 23 def update @mockup.update_attributes(mockup_params) render json: @mockup, status: :ok end |