1

How can I get rinku to run and the page to load properly?

Error message: uninitialized constant ActionView::CompiledTemplates::Rinku

Steps taken:

  • Installed rinku gem and rake-compiler and ran $ rake per the gem developer's instructions
  • Inserted require 'rinku' into the controller file
  • Inserted the following into the view file <% text = "Go to http://www.abc.com or email me at dude@abc.com" %> and <%= Rinku.auto_link(text, mode=:all, link_attr=nil, skip_tags=nil) %>
djmb
  • 59
  • 1
  • 5

2 Answers2

2

The correct installation of Rinku in a Rails 3.2 app is:

  1. Add gem 'rinku' to your Gemfile.
  2. bundle install
  3. Restart your Rails server, if it was already running.

Don't add require 'rinku' or bother with rake or the rake-compiler.

The Rinku.auto_link(text) should now work in your view. If the HTML renders as plain text, you may need to add raw or html_safe e.g.

<%= raw Rinku.auto_link(text) %> or <%= Rinku.auto_link(text).html_safe %>

Versions: rails 3.2.13, rinku 1.7.3

scarver2
  • 7,887
  • 2
  • 53
  • 61
1

auto_link has been removed from Rails after version 3. Replacement gems are available.

Community
  • 1
  • 1
Mori
  • 27,279
  • 10
  • 68
  • 73
  • Thanks Mori. Yeah, I saw that one. Is there a way to do it with the "rails_autolink" standalone gem instead of "rails_rinku"? Looks like there are some segfaults issues – djmb May 10 '13 at 13:38