I have this code:
def show_block_path
Rails.application.routes.url_helpers.gate_path(resource_id))
end
I'm trying have to refactor it:
def show_block_path
Rails.application.routes.url_helpers."{resource_type.downcase}"_path(resource_id))
end
resource_type.downcase
is "gate"
, but the method doesn't work. Why?