Sunday 15 March 2015

ruby on rails 4 - Using find or where in custom helper module -



ruby on rails 4 - Using find or where in custom helper module -

i have custom helper module. code trivial. whenever execute activerecord find_by_icon line error says "wrong argument type techtag (expected string)" if take exact same line , execute on rails console record returned. if comment out line code executes fine. there need include create work? based on examples have seen online no includes required work. appreciate taking time help me.

module redcarpethelper class htmlblockcode < redcarpet::render::html def image(link, alt_text, title) @hi = techtag.find_by_icon_file_name("svg.svg") end end end

dan

this because method returning lastly look (the query). if place string after @hi line works fine.

ruby-on-rails-4

No comments:

Post a Comment