nesquena/rabl — Issue #145: remove_attribute(s)
Author: vizjerai
Created: 2011-12-12 21:39:35+00:00
State: open

I've got a case where I would like to extend a view but want to insert some attributes between some other ones. A quick way might be by removing an attribute then re-add it later.

This would also allow just removing attributes that aren't needed.

_index.json.rabl

```ruby
attributes :id, :created_at, :updated_at
```

show.json.rabl

```ruby
extends "_index"
remove_attributes :created_at, :updated_at
attribute :name
attributes :created_at, :updated_at
```

expected outcome if extends wasn't used

```ruby
attributes :id, :name, :created_at, :updated_at
```