I am developing an api for an iOS application. I currently have a Property class that has many Issues. In the API controller for Index I have the following code:
def index
@issues = @property.issues
end
I am setting the @property
var with a before_action
I currently have this in my routes file inside my API wrapper routes:
resources :issues do
resources :comments
end
It is obviously putting the proper REST verbs for to the calls, but my issue is I am in need of passing the parameter of property_id in order for my before action to find Property.where(id: pay ams[:property_id]
.
?property_id=1
or in the request header? In Rails 4, would the strong parameters take place and I need to pass a body of:
{ "issue":["property_id":2] }
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.