Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Expose pages#show route via GET #49

Merged
merged 1 commit into from

2 participants

@arvida

Hi there,

I noticed this when I tried adding high_voltage to a edge rails app:

A route defined with #match will raise a error message in edge rails if you haven't specified :via => :get or similair for that route. I changed the route setup to use get instead as (I guess) that is the only HTTP method that you want to use for static pages.

See this commit on rails for more info on the error:
rails/rails@56cdc81#LOL61

I didn't add any tests for this as I am unsure how to go about on those. All the current tests pass now. If I add a Gemfile that uses edge rails I guess the tests for ruby versions < 1.9.3 will break when that Gemfile is used?

Let me know what you think, maybe this change should be saved until rails 4 is released? :neckbeard:

@arvida arvida Expose pages#show route as GET
* For rails 4 compatibility (#match will raise a warning)

See this commit on rails for more info:
rails/rails@56cdc81#LOL61
176895f
@harlow
Collaborator

@arvida good catch. Will get this into master for next release

@harlow harlow was assigned
@harlow harlow merged commit 176895f into thoughtbot:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 23, 2012
  1. @arvida

    Expose pages#show route as GET

    arvida authored
    * For rails 4 compatibility (#match will raise a warning)
    
    See this commit on rails for more info:
    rails/rails@56cdc81#LOL61
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  config/routes.rb
View
2  config/routes.rb
@@ -1,5 +1,5 @@
Rails.application.routes.draw do
if HighVoltage.routes
- match "/#{HighVoltage.content_path}*id" => 'high_voltage/pages#show', :as => :page, :format => false
+ get "/#{HighVoltage.content_path}*id" => 'high_voltage/pages#show', :as => :page, :format => false
end
end
Something went wrong with that request. Please try again.