nesquena / rabl

General ruby templating with json, bson, xml, plist and msgpack support
http://blog.codepath.com/2011/06/27/building-a-platform-api-on-rails/
MIT License
3.64k stars 334 forks source link

Unable to pass params to a model method from rabl view #688

Open yo-gen opened 7 years ago

yo-gen commented 7 years ago

Hi.

I have the following rabl file

object false
child @categories => :categories do
  attributes :id,:name
  child :active_channel => :spree_channels do |channel|
    extends("spree/api/yt_categories/channel_show")`
  end
end

I want to know how to pass a parameter from this rabl view to the :active_channel method which is defined in the model. Passing it like this :active_model(@current_api_user.id) doesn't work