File tree 2 files changed +22
-1
lines changed
2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change
1
+ class DojosController < ApplicationController
2
+ def index
3
+ @dojo_data = [ ]
4
+ Dojo . active . each do |dojo |
5
+ @dojo_data << {
6
+ name : dojo . name ,
7
+ url : dojo . url ,
8
+ prefecture : dojo . prefecture . region ,
9
+ linked_text : "<a href='#{ dojo . url } '>'#{ dojo . name } </a>(#{ dojo . prefecture . region } )" ,
10
+ }
11
+ end
12
+
13
+ respond_to do |format |
14
+ format . json { render json : @dojo_data }
15
+
16
+ # No corresponding View for now.
17
+ # Only for API: GET /dojos.json
18
+ format . html { redirect_to root_url ( anchor : 'dojos' ) }
19
+ end
20
+ end
21
+ end
Original file line number Diff line number Diff line change 51
51
get "/kata" => "docs#kata"
52
52
#get "/debug/kata" => "docs#kata"
53
53
54
-
54
+ resources :dojos , only : %i( index ) # Only API: GET /dojos.json
55
55
resources :docs , only : %i( index show )
56
56
resources :podcasts , only : %i( index show )
57
57
resources :spaces , only : %i( index )
You can’t perform that action at this time.
0 commit comments