railstar 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
+ require 'rails/source_annotation_extractor'
1
2
  module Railstar
2
3
  class GeneralController < ApplicationController
3
4
  layout "railstar/application"
@@ -13,7 +14,9 @@ module Railstar
13
14
  @cols = %w(name human_name sql_type klass default type null)
14
15
  end
15
16
 
16
- def code
17
+ def routes
18
+ Rails.application.reload_routes!
19
+ @routes = Rails.application.routes.routes
17
20
  end
18
21
  end
19
22
  end
@@ -35,11 +35,12 @@
35
35
  <span class="icon-bar"></span>
36
36
  <span class="icon-bar"></span>
37
37
  </a>
38
- <%= link_to Railstar.env["product_name"], root_path, :class => "brand" %>
38
+ <%= link_to Railstar.env["product_name"], main_app.root_path, :class => "brand" %>
39
39
  <div class="nav-collapse">
40
40
  <ul class="nav">
41
- <li class="<%= "active" if current_page?(database_path) %>"><%= link_to "Database", database_path %></li>
42
- <li class="<%= "active" if current_page?(code_path) %>"><%= link_to "Code", code_path, {} %></li>
41
+ <li><%= link_to "Top", root_path %></li>
42
+ <li><%= link_to "Database", database_path %></li>
43
+ <li><%= link_to "Routes", routes_path, {} %></li>
43
44
  </ul>
44
45
  </div><!--/.nav-collapse -->
45
46
  </div>
@@ -0,0 +1,25 @@
1
+ <div class="container">
2
+ <div>
3
+ <table class="table table-bordered table-condensed">
4
+ <thead>
5
+ <tr>
6
+ <th>name</th>
7
+ <th>method</th>
8
+ <th>path</th>
9
+ <th>app</th>
10
+ </tr>
11
+ </thead>
12
+ <tbody>
13
+ <% name = nil %>
14
+ <% @routes.each do |route| %>
15
+ <tr>
16
+ <td><%= name = route.name || name %></td>
17
+ <td><%= route.constraints[:request_method].inspect.gsub(/(nil)|[\/^$]/,"") %></td>
18
+ <td><%= route.path.spec %></td>
19
+ <td><%= route.defaults %></td>
20
+ </tr>
21
+ <% end %>
22
+ </tbody>
23
+ </table>
24
+ </div><!--/span-->
25
+ </div><!--/.fluid-container-->
data/config/routes.rb CHANGED
@@ -2,7 +2,7 @@ Railstar::Engine.routes.draw do
2
2
  root :to => "general#index"
3
3
 
4
4
  match "database" => "general#database"
5
- match "code" => "general#code"
5
+ match "routes" => "general#routes"
6
6
 
7
7
  resources :feedbacks
8
8
  end
@@ -1,4 +1,4 @@
1
- class Railstar::InstallGenerator < Rails::Generators::NamedBase
1
+ class Railstar::InstallGenerator < Rails::Generators::Base
2
2
  source_root File.expand_path('../templates', __FILE__)
3
3
 
4
4
  def copy_config_file
@@ -1,3 +1,3 @@
1
1
  module Railstar
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end