Skip to content

Instantly share code, notes, and snippets.

@jgrau
Created June 5, 2010 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgrau/426926 to your computer and use it in GitHub Desktop.
Save jgrau/426926 to your computer and use it in GitHub Desktop.
# ofcause action_path doesn't work with this syntax
def init_and_slug_redirect
@place = Place.published.find(params[:id])
action = self.action_name
redirect_to action_path(@place), :status => :moved_permanently unless @place.friendly_id_status.best?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment