Module: TransitionButtons::Routing

Defined in:
lib/transition_buttons/routing.rb

Overview

Adds a transitionable helper to the routes DSL:

resources :posts do
transitionable          # => POST /posts/:id/transition  (transition_post)
end

Equivalent to writing member { post :transition }, but named so intent is obvious and so the route name stays consistent with what the view helper's polymorphic_path([:transition, record]) expects.

Instance Method Summary collapse

Instance Method Details

#transitionableObject



12
13
14
# File 'lib/transition_buttons/routing.rb', line 12

def transitionable
  member { post :transition }
end