-2

i am working on a rails blog app, and i need to add user tags on post. example i write and post the following; 'my dogs name is john. #dogs' i want dogs to be clickable text on that post. how do i display a clickable #dogs text on view to a route /dogs. on a regular views page we just use a link_to helper, how can i use that or anything else to do so

alphons
  • 67
  • 5

1 Answers1

0

You could write a view helper and pass the text into that view helper. The View helper can parse the text using regular expressions and replace the results with a link.

Markus Graf
  • 533
  • 3
  • 16