Class: Effective::PermalinksController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/effective/permalinks_controller.rb

Instance Method Summary collapse

Instance Method Details

#redirectObject



3
4
5
6
7
8
9
# File 'app/controllers/effective/permalinks_controller.rb', line 3

def redirect
  @permalink = Effective::Permalink.find_by! slug: params[:slug]

  authorize! :redirect, @permalink

  redirect_to redirect_path_for(@permalink), allow_other_host: (@permalink.target == :url)
end