diff --git a/railties/builtin/rails_info/rails/info/_properties.html.erb b/railties/builtin/rails_info/rails/info/_properties.html.erb new file mode 100644 index 0000000..dd8d53f --- /dev/null +++ b/railties/builtin/rails_info/rails/info/_properties.html.erb @@ -0,0 +1,5 @@ +<% if consider_all_requests_local? || local_request? %> + <%= Rails::Info.to_html.html_safe %> +<% else %> +

For security purposes, this information is only available to local requests.

+<% end %> \ No newline at end of file diff --git a/railties/builtin/rails_info/rails/info/show.html.erb b/railties/builtin/rails_info/rails/info/show.html.erb new file mode 100644 index 0000000..eb622db --- /dev/null +++ b/railties/builtin/rails_info/rails/info/show.html.erb @@ -0,0 +1,268 @@ + + + + Ruby on Rails: Welcome aboard + + <%= javascript_include_tag :defaults %> + + + +
+ + +
+ + +
+

About your application’s environment

+
+ <%= render :partial => 'properties' %> +
+
+ +
+

Getting started

+

Here’s how to get rolling:

+ +
    +
  1. +

    Use rails generate to create your models and controllers

    +

    To see all available options, run it without parameters.

    +
  2. + +
  3. +

    Set up a default route and remove or rename this file

    +

    Routes are set up in config/routes.rb.

    +
  4. + +
  5. +

    Create your database

    +

    Run rake db:migrate to create your database. If you're not using SQLite (the default), edit config/database.yml with your username and password.

    +
  6. +
+
+
+ + +
+ + diff --git a/railties/builtin/rails_info/rails/info_controller.rb b/railties/builtin/rails_info/rails/info_controller.rb index 196eeb4..d5179f9 100644 --- a/railties/builtin/rails_info/rails/info_controller.rb +++ b/railties/builtin/rails_info/rails/info_controller.rb @@ -1,15 +1,12 @@ class Rails::InfoController < ActionController::Base - def properties - if consider_all_requests_local? || local_request? - render :inline => Rails::Info.to_html - else - render :text => '

For security purposes, this information is only available to local requests.

', :status => :forbidden - end + + append_view_path File.join(File.dirname(__FILE__), '..') + + def show end - - protected - - def consider_all_requests_local? - Rails.application.config.consider_all_requests_local + + def properties + render :partial => 'properties' end + end diff --git a/railties/builtin/rails_info/rails/info_helper.rb b/railties/builtin/rails_info/rails/info_helper.rb index e5605a8..068323e 100644 --- a/railties/builtin/rails_info/rails/info_helper.rb +++ b/railties/builtin/rails_info/rails/info_helper.rb @@ -1,2 +1,5 @@ module Rails::InfoHelper + def consider_all_requests_local? + Rails.application.config.consider_all_requests_local + end end diff --git a/railties/lib/generators/rails/app/templates/config/routes.rb b/railties/lib/generators/rails/app/templates/config/routes.rb index d6c0365..4395e7c 100644 --- a/railties/lib/generators/rails/app/templates/config/routes.rb +++ b/railties/lib/generators/rails/app/templates/config/routes.rb @@ -46,13 +46,13 @@ # resources :products # end - # You can have the root of your site routed with "root" - # just remember to delete public/index.html. - # root :to => "welcome#index" - # See how all your routes lay out with "rake routes" # This is a legacy wild controller route that's not recommended for RESTful applications. # Note: This route will make all actions in every controller accessible via GET requests. # match ':controller(/:action(/:id(.:format)))' + + # You can have the root of your site routed with "root" + # root :to => "welcome#index" + root :to => "Rails::Info#show" end diff --git a/railties/lib/generators/rails/app/templates/public/index.html b/railties/lib/generators/rails/app/templates/public/index.html deleted file mode 100644 index ef916f9..0000000 --- a/railties/lib/generators/rails/app/templates/public/index.html +++ /dev/null @@ -1,278 +0,0 @@ - - - - Ruby on Rails: Welcome aboard - - - - - - -
- - -
- - - - -
-

Getting started

-

Here’s how to get rolling:

- -
    -
  1. -

    Use rails generate to create your models and controllers

    -

    To see all available options, run it without parameters.

    -
  2. - -
  3. -

    Set up a default route and remove or rename this file

    -

    Routes are set up in config/routes.rb.

    -
  4. - -
  5. -

    Create your database

    -

    Run rake db:migrate to create your database. If you're not using SQLite (the default), edit config/database.yml with your username and password.

    -
  6. -
-
-
- - -
- -