Module: GtfsEngine::DefaultViewsHelper
- Defined in:
- app/helpers/gtfs_engine/default_views_helper.rb
Instance Method Summary collapse
Instance Method Details
#index(json, records) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'app/helpers/gtfs_engine/default_views_helper.rb', line 17 def index(json, records) json.cache! [controller_name, filter] do json.ignore_nil! true json.status 'success' json.data do json.array!(records) {|record| json.extract! record, *fields } end end end |
#show(json, record) ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'app/helpers/gtfs_engine/default_views_helper.rb', line 28 def show(json, record) json.cache! record do json.ignore_nil! true json.status 'success' json.data do json.extract! record, *fields end end end |