How to redirect to a permalink that is stored as a column in my model
I am building something where contributors can post content to my site. I want to create a link where other users can click on and bring the user to the respective contributor's own website. The permalink for each contributor's website is a column in my contributor mod开发者_如何学编程el.
Everything I tried so far just appends the contributor's permalink to the end of the existing URL. ie, www.mysite.com/xxx/www.contributorsite.com instead of just redirecting to www.contributorcite.com
Please help
Try something like this (should probably build the link in the controller instead of model, or just append http:// to the user entered info):
<% link = "http://"+user.permalink %>
<%= link_to "Users website", link %>
精彩评论