Skip to content

Instantly share code, notes, and snippets.

@mikeric
Last active December 28, 2015 17:38

Revisions

  1. mikeric revised this gist Nov 18, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion resource-routing-splats.rb
    Original file line number Diff line number Diff line change
    @@ -14,6 +14,6 @@
    resources :events do
    member do
    get :schedule
    get '*', :to => :show
    get '*params', :to => :show
    end
    end
  2. mikeric created this gist Nov 18, 2013.
    19 changes: 19 additions & 0 deletions resource-routing-splats.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    # the following works as intended

    resources :events do
    member do
    get :schedule
    end
    end

    match '/events/:id/*params' => 'events#show'

    # would be nice to accomplish the same thing using resource routing methods instead of an
    # explicit call to #match. pseudo code below.

    resources :events do
    member do
    get :schedule
    get '*', :to => :show
    end
    end