Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- App.Router.map ->
- @resource 'site', ->
- @route 'show', path: '/:site_id'
- #routes.rb
- Rails.application.routes.draw do
- root to: 'home#index'
- scope constraints: { format: :html } do
- get '/site' => 'home#index'
- get '/site/:site_id' => 'home#index'
- resources 'sites'
- end
- end
- class SitesController < ApplicationController
- def show
- render json: File.open('data/sites.json').read
- end
- end
- App.Site = DS.Model.extend()
- {
- "site": [
- {
- "id": "1",
- "name": "Place One",
- "type": "Type One"
- }, {
- "id": "2",
- "name": "Place One",
- "type": "Type Two"
- }
- ]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement