Improve Rails 3 route processing #116

Merged
merged 11 commits into from Jul 25, 2012

Conversation

Projects
None yet
2 participants
@presidentbeef
Owner

presidentbeef commented Jul 20, 2012

This patch fixes some issues with Rails 3 route processing.

Improvements include:

  • Handling "controller" blocks
controller :whatever do
  get :something => :else
end
  • Handling routes that don't specify a controller
resource :book do
  get :reserve
end
  • Handling :to options in match
match 'path', :to => 'controller#action'
  • Handling :to options in blocks
resource :book do
  get 'reserve', :to => :checkout
end
exp
end
def process_resources_block exp
- process_resources exp[1]

This comment has been minimized.

@oreoshake

oreoshake Jul 25, 2012

Contributor

alias :process_resources_block, :process_resource_block?

@oreoshake

oreoshake Jul 25, 2012

Contributor

alias :process_resources_block, :process_resource_block?

This comment has been minimized.

@presidentbeef

presidentbeef Jul 25, 2012

Owner

They are slightly different...

@presidentbeef

presidentbeef Jul 25, 2012

Owner

They are slightly different...

@oreoshake

This comment has been minimized.

Show comment
Hide comment
@oreoshake

oreoshake Jul 25, 2012

Contributor

code climate is making me overthink this, but yeah, 👍

Contributor

oreoshake commented Jul 25, 2012

code climate is making me overthink this, but yeah, 👍

presidentbeef added a commit that referenced this pull request Jul 25, 2012

@presidentbeef presidentbeef merged commit 57c2672 into master Jul 25, 2012

@presidentbeef presidentbeef deleted the improve_rails3_route_processing branch Feb 25, 2015

@presidentbeef presidentbeef locked and limited conversation to collaborators Feb 16, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.