You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it would be really handy to conditionally add attributes to an api template.
class User < ActiveRecord::Base
acts_as_api
api_accessible :user_show do |t|
t.add :first_name
t.add :last_name
t.add :age
t.add :favorite_beer if age > 21
end
end
this is a contrived example, but i do have a (legacy) class that has many, many one-to-many relationships. it would be helpful to conditionally include certain attributes based on the value of another.
cheers!
The text was updated successfully, but these errors were encountered:
it would be really handy to conditionally add attributes to an api template.
this is a contrived example, but i do have a (legacy) class that has many, many one-to-many relationships. it would be helpful to conditionally include certain attributes based on the value of another.
cheers!
The text was updated successfully, but these errors were encountered: