Rails rabl - returning ALL attributes, not just named ones

json, rabl, ruby-on-rails

Solution

You should be able to use `.column_names`:

attributes *User.column_names

Problem

Rabl allows you to grab the attributes by naming them in your view, for instance: ``` object @user attributes :name, :email ``` I have a model whose attributes are will not be known, but I'd like to display everything returned from the controller in my instance variable using rabl. Is there a shortcut like: ``` attributes :all ``` etc. Thanks

Original source