Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update match to get in routes and docs

  • Loading branch information...
commit a1adc0dc8b7ba86efa48539bf929acbd5c8c4caa 1 parent 087c1dd
@mjankowski mjankowski authored
Showing with 5 additions and 5 deletions.
  1. +3 −3 README.md
  2. +2 −2 spec/dummy/config/routes.rb
View
6 README.md
@@ -51,7 +51,7 @@ By default, the static page routes will be like /pages/:id (where :id is the vie
If you want to route to a static page in another location (for example, a homepage), do this:
- match 'pages/home' => 'high_voltage/pages#show', :id => 'home'
+ get 'pages/home' => 'high_voltage/pages#show', :id => 'home'
In that case, you'd need an app/views/pages/home.html.erb file.
@@ -65,7 +65,7 @@ route generated by High Voltage itself.
For example, this will work for top-level routes (we will
get a named route called `static_path` which does not conflict with the generated `page_path` method):
- match '/:id' => 'high_voltage/pages#show', :as => :static, :via => :get
+ get '/:id' => 'high_voltage/pages#show', :as => :static, :via => :get
#### Specifying a root path
@@ -129,7 +129,7 @@ Create a PagesController of your own:
Override the default route:
# in config/routes.rb
- match "/pages/*id" => 'pages#show', :as => :page, :format => false
+ get "/pages/*id" => 'pages#show', :as => :page, :format => false
# if routing the root path, update for your controller
root :to => 'pages#show', :id => 'home'
View
4 spec/dummy/config/routes.rb
@@ -1,4 +1,4 @@
Dummy::Application.routes.draw do
- match "/subclassed_pages/*id" => 'subclassed_pages#show', :format => false
- match "/alternative_finder/*id" => 'alternative_finder#show', :format => false
+ get "/subclassed_pages/*id" => 'subclassed_pages#show', :format => false
+ get "/alternative_finder/*id" => 'alternative_finder#show', :format => false
end
Please sign in to comment.
Something went wrong with that request. Please try again.