Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require 'ramaze'
require 'json'

class MainController < ::Ramaze::Controller

  Ramaze::Route[%r{^/foo$}] = '/index'

  provide :json, :type => 'application/json' do |action, value|
    value.to_json
  end

  def index
    @items = %w( a b c )
  end

end

Ramaze.start