Rails 3 routes
This commit is contained in:
4
Gemfile
4
Gemfile
@@ -21,3 +21,7 @@ gem 'shoulda', "~>2.11"
|
|||||||
gem 'acts_as_paranoid', '~>0.4'
|
gem 'acts_as_paranoid', '~>0.4'
|
||||||
#gem 'acts_as_versioned', '~>0.6', :ignore_dependencies => true
|
#gem 'acts_as_versioned', '~>0.6', :ignore_dependencies => true
|
||||||
gem 'acts_as_list', '~>0.2'
|
gem 'acts_as_list', '~>0.2'
|
||||||
|
|
||||||
|
group :development, :production do
|
||||||
|
gem 'brazilian-rails', '3.3.0', :path => './vendor/gems/brazilian-rails/brI18n/'
|
||||||
|
end
|
||||||
|
|||||||
@@ -3,6 +3,11 @@ PATH
|
|||||||
specs:
|
specs:
|
||||||
bluecloth (1.0.0)
|
bluecloth (1.0.0)
|
||||||
|
|
||||||
|
PATH
|
||||||
|
remote: ./vendor/gems/brazilian-rails/brI18n/
|
||||||
|
specs:
|
||||||
|
brazilian-rails (3.3.0)
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
@@ -123,6 +128,7 @@ DEPENDENCIES
|
|||||||
acts_as_list (~> 0.2)
|
acts_as_list (~> 0.2)
|
||||||
acts_as_paranoid (~> 0.4)
|
acts_as_paranoid (~> 0.4)
|
||||||
bluecloth (= 1.0.0)!
|
bluecloth (= 1.0.0)!
|
||||||
|
brazilian-rails (= 3.3.0)!
|
||||||
calendar_helper (~> 0.2)
|
calendar_helper (~> 0.2)
|
||||||
coffee-rails (~> 3.2.1)
|
coffee-rails (~> 3.2.1)
|
||||||
haml (~> 3.1)
|
haml (~> 3.1)
|
||||||
|
|||||||
@@ -16,11 +16,11 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
require 'yaml'
|
require 'yaml'
|
||||||
|
require 'authentication.rb'
|
||||||
|
|
||||||
class ApplicationController < ActionController::Base
|
class ApplicationController < ActionController::Base
|
||||||
helper :all
|
helper :all
|
||||||
protect_from_forgery
|
protect_from_forgery
|
||||||
filter_parameter_logging :password
|
|
||||||
|
|
||||||
include AuthenticationSystem
|
include AuthenticationSystem
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
%script{:type => 'text/javascript'}
|
%script{:type => 'text/javascript'}
|
||||||
== BASE_PATH = "#{App.base_path}";
|
== BASE_PATH = "#{App.base_path}";
|
||||||
= javascript_include_merged :base
|
/= javascript_include_merged :base
|
||||||
|
|
||||||
%body{'onload' => 'javascript: startup()'}
|
%body{'onload' => 'javascript: startup()'}
|
||||||
#wrapper
|
#wrapper
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
require File.expand_path('../boot', __FILE__)
|
require File.expand_path('../boot', __FILE__)
|
||||||
|
|
||||||
require 'rails/all'
|
require 'rails/all'
|
||||||
|
require 'lib/nasty_hacks.rb'
|
||||||
require 'active_support/core_ext/numeric/bytes'
|
require 'active_support/core_ext/numeric/bytes'
|
||||||
|
|
||||||
if defined?(Bundler)
|
if defined?(Bundler)
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
require 'brI18n'
|
||||||
|
|
||||||
WikiUFC::Application.configure do
|
WikiUFC::Application.configure do
|
||||||
# Settings specified here will take precedence over those in config/application.rb
|
# Settings specified here will take precedence over those in config/application.rb
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
require 'brI18n'
|
||||||
|
|
||||||
WikiUFC::Application.configure do
|
WikiUFC::Application.configure do
|
||||||
# Settings specified here will take precedence over those in config/application.rb
|
# Settings specified here will take precedence over those in config/application.rb
|
||||||
|
|
||||||
@@ -65,3 +67,4 @@ WikiUFC::Application.configure do
|
|||||||
# with SQLite, MySQL, and PostgreSQL)
|
# with SQLite, MySQL, and PostgreSQL)
|
||||||
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
125
config/routes.rb
125
config/routes.rb
@@ -1,58 +1,91 @@
|
|||||||
|
# Wiki UFC
|
||||||
|
# Copyright (C) 2007, Adriano, Alinson, Andre, Rafael e Bustamante
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as
|
||||||
|
# published by the Free Software Foundation, either version 3 of the
|
||||||
|
# License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
WikiUFC::Application.routes.draw do
|
WikiUFC::Application.routes.draw do
|
||||||
# The priority is based upon order of creation:
|
|
||||||
# first created -> highest priority.
|
|
||||||
|
|
||||||
# Sample of regular route:
|
resources :users
|
||||||
# match 'products/:id' => 'catalog#view'
|
|
||||||
# Keep in mind you can assign values other than :controller and :action
|
|
||||||
|
|
||||||
# Sample of named route:
|
resources :courses do
|
||||||
# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
|
member do
|
||||||
# This route can be invoked with purchase_url(:id => product.id)
|
get :enroll
|
||||||
|
get :unenroll
|
||||||
|
end
|
||||||
|
|
||||||
# Sample resource route (maps HTTP verbs to controller actions automatically):
|
resources :events do
|
||||||
# resources :products
|
member do
|
||||||
|
post :undelete
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Sample resource route with options:
|
resources :news do
|
||||||
# resources :products do
|
member do
|
||||||
# member do
|
post :undelete
|
||||||
# get 'short'
|
end
|
||||||
# post 'toggle'
|
end
|
||||||
# end
|
|
||||||
#
|
|
||||||
# collection do
|
|
||||||
# get 'sold'
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
|
|
||||||
# Sample resource route with sub-resources:
|
resources :wiki do
|
||||||
# resources :products do
|
member do
|
||||||
# resources :comments, :sales
|
get :move_down
|
||||||
# resource :seller
|
post :undelete
|
||||||
# end
|
get :diff
|
||||||
|
get :versions
|
||||||
|
get :move_up
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Sample resource route with more complex sub-resources
|
resources :attachments do
|
||||||
# resources :products do
|
member do
|
||||||
# resources :comments
|
post :undelete
|
||||||
# resources :sales do
|
get :download
|
||||||
# get 'recent', :on => :collection
|
end
|
||||||
# end
|
end
|
||||||
# end
|
end
|
||||||
|
|
||||||
# Sample resource route within a namespace:
|
# Log
|
||||||
# namespace :admin do
|
#match 'controllerlog' => '#index', :as => :with_options
|
||||||
# # Directs /admin/products/* to Admin::ProductsController
|
|
||||||
# # (app/controllers/admin/products_controller.rb)
|
|
||||||
# resources :products
|
|
||||||
# end
|
|
||||||
|
|
||||||
# You can have the root of your site routed with "root"
|
# Services
|
||||||
# just remember to delete public/index.html.
|
match 'services/preview' => 'wiki#preview', :as => :preview
|
||||||
# root :to => 'welcome#index'
|
|
||||||
|
|
||||||
# See how all your routes lay out with "rake routes"
|
# Widgets
|
||||||
|
match 'widgets/calendar/:id/:year/:month' => 'events#mini_calendar'
|
||||||
|
|
||||||
# This is a legacy wild controller route that's not recommended for RESTful applications.
|
# Authentication
|
||||||
# Note: This route will make all actions in every controller accessible via GET requests.
|
with_options :controller => 'users' do |user|
|
||||||
# match ':controller(/:action(/:id))(.:format)'
|
user.match 'login', :action => 'login'
|
||||||
|
user.match 'logout', :action => 'logout'
|
||||||
|
user.match 'signup', :action => 'signup'
|
||||||
|
user.match 'settings', :action => 'settings'
|
||||||
|
user.match 'recover_password', :action => 'recover_password'
|
||||||
|
user.match 'recover_password/:key', :action => 'recover_password'
|
||||||
|
end
|
||||||
|
|
||||||
|
# Pagina pessoal
|
||||||
|
match '/dashboard' => 'users#dashboard', :as => :dashboard
|
||||||
|
match '/dashboard/:secret.:format' => 'users#dashboard', :as => :formatted_dashboard
|
||||||
|
|
||||||
|
# Stylesheets
|
||||||
|
match 'stylesheets/cache/:action.:format' => 'stylesheets#index'
|
||||||
|
match 'stylesheets/cache/:action.:color.:format' => 'stylesheets#index'
|
||||||
|
|
||||||
|
# Mudancas recentes global
|
||||||
|
match 'log' => 'log#index', :as => :log, :format => 'html'
|
||||||
|
match 'log.:format' => 'log#index', :as => :formatted_log
|
||||||
|
|
||||||
|
# Front page
|
||||||
|
match '' => 'courses#index', :as => :index
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user