2

I have an action called home. I store "home_url" in the database.

I need to generate the full URL form this string.

For example,

Input: "home_url"

Desired output: "http://myhostname/home/index.html"

1 Answer 1

5

Try this

self.send("home_url")

For example

<%= link_to "Home", self.send("home_url") %>

And obviously home_url should be presented in your routes.rb file

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.