ruby on rails - Passing a list of same parameters with a different value -


so creating client methods create path hit external service. also, using addressable gem.

here example:

def get_member(ord_id, member_id)   path = '/organizations/{ord_id}/people/{member_id}'   hash = get(path, member_id: member_id, org_id: ord_id)    { member.custom_deserialize_method(hash) } end 

this works if path simple above.

now want write method different path bulk this:

organizations/ab9176be/members/bulk?memberid=8e936891&memberid=b71c4f1e  (this not web url. service end point) 

the above method can have multiple memberid params. know addressable has expand method , ruby has to_param method.

but not not know if in situation. appreciate here.

route globbing

i'm sure if help, considering you've had no responses, felt i'd best posting

i learnt route globbing few weeks back. bascially allows define routes this:

get 'books/*section/:title', to: 'books#show'

would match books/some/section/last-words-a-memoir params[:section] equals 'some/section', , params[:title] equals 'last-words-a-memoir'.


although not directly related solution question, may appreciate how rails processes of routes in app. essentially, means can add many "wildcard" routes need, various elements of route being compiled in params hash


Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

The canvas has been tainted by cross-origin data in chrome only -