David Hill


520 Experience
5 Lessons Completed
0 Questions Solved


Posted in rails link_to_if controller, action and format exist

It looks like the problem is that the parameters being passed into link_to_if aren't quite right.

The documentation for the function at api.rubyonrails.org shows this as the signature for the method:
link_to_if(condition, name, options = {}, html_options = {}, &block)

The first parameter you pass will be evaluated down to true/false, which determine whether or not a link is rendered (true), or just text (false). After that you can pass in the text to display (klass.name) and the URL options (controller, action, etc).

Hope that helps!

Posted in Looking for Rails work? / Hiring Rails developers?

SEEKING WORK: Senior Ruby Developer
Location: Kansas City, Missouri
Unable to relocate (the wife likes it here), so looking for local or remote contract/project work. The easiest way to contact me is email: david.esmale@gmail.com

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

© 2024 GoRails, LLC. All rights reserved.