gazay/gon — Issue #26: View helpers in rabl template throws 'undefined method' if used with gon
Author: arnabc
Created: 2012-03-05 21:45:06+00:00
State: open

My rabl templates are working fine if I use it outside `gon` for example as a response to XHR requests, but if I use the same template with `gon` it throws error in view helper methods used in the `rabl` templates. In Rabl, using Rails view helpers are allowed, so it seems that `gon` might be causing some issue in there, is it an issue with the view context ?

Here's my sample rable template:

```ruby
attributes :id, :name, :created_at
node(:time_ago) { |m| distance_of_time_in_words(m.created_at, Time.now) }
```

There seems to be an issue filed in the Rabl repository related to this problem:
https://github.com/nesquena/rabl/issues/147

Thanks,
Arnab