Rails rabl - returning ALL attributes, not just named ones Rails rabl - returning ALL attributes, not just named ones json json

Rails rabl - returning ALL attributes, not just named ones


You should be able to use .column_names:

attributes *User.column_names


If you want to get rid of some columns, like "created_at" and "updated_at":

attributes *User.column_names - ["created_at", "updated_at"]