alchemy_cms

https://github.com/magiclabs/alchemy_cms

Ruby

AlchemyCMS is a powerful, flexible and user centric Rails 5 CMS. 🧙🏻‍♂️

Alchemy::PageRedirects#redirect_url

Returns an URL to redirect the request to.

== Lookup:

1. If the page is not published and we have a published child,
   we return the url top that page. (Configurable through +redirect_to_public_child+).
2. If the page layout of the page found has a controller and action configured,
   we return the url to that route. (Configure controller and action in `page_layouts.yml`).
3. If the current page URL has no locale prefixed, but we should have one,
   we return the prefixed URL.
4. If no redirection is needed returns nil.

Source | Google | Stack overflow

Edit

git clone [email protected]:magiclabs/alchemy_cms.git

cd alchemy_cms

open app/controllers/concerns/alchemy/page_redirects.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Alchemy--PageRedirects-redirect_url-for-pr


# Commit to git

git add app/controllers/concerns/alchemy/page_redirects.rbgit commit -m "better docs for Alchemy::PageRedirects#redirect_url"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Alchemy--PageRedirects-redirect_url-for-pr

hub pull-request


# Celebrate!