-
Notifications
You must be signed in to change notification settings - Fork 468
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #280 from tstrachota/concerns
Name substitution for referenced param_groups defined in concerns
- Loading branch information
Showing
4 changed files
with
69 additions
and
2 deletions.
There are no files selected for viewing
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
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
31 changes: 31 additions & 0 deletions
31
spec/dummy/app/controllers/overridden_concerns_controller.rb
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
class OverriddenConcernsController < ApplicationController | ||
|
||
resource_description { resource_id 'overridden_concern_resources' } | ||
|
||
apipie_concern_subst(:concern => 'user') | ||
include ::Concerns::SampleController | ||
|
||
def_param_group :concern do | ||
param :concern, String | ||
end | ||
|
||
api :PUT, '/:resource_id/:id' | ||
param :custom_parameter, String, "New parameter added by the overriding method" | ||
param_group :concern, ::Concerns::SampleController | ||
def update | ||
super | ||
end | ||
|
||
api :POST, '/:resource_id', "Create a :concern" | ||
param_group :concern | ||
def create | ||
super | ||
end | ||
|
||
api :GET, '/:resource_id/custom' | ||
param :concern, String | ||
def custom | ||
render :text => "OK #{params.inspect}" | ||
end | ||
|
||
end |
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