David Hill


220 Experience
2 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: [email protected]

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2020 GoRails, LLC. All rights reserved.