Project

General

Profile

Actions

Defect #38992

open

How do I use helper_queries_column_value helper hook?

Added by keineahnung 2345 over 1 year ago. Updated 8 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

In app/helpers/queries_helper.rb, there is:

  def column_value(column, item, value)
    content = ...

    call_hook(:helper_queries_column_value,
              {:content => content, :column => column, :item => item, :value => value})

    content
  end

In my xxx_helper_queries_column_value_hook.rb:

  def helper_queries_column_value(context = { })
    if context[:column].name ==  :action
      context[:content] = "Ushiro" 
    end
  end

I can change the parameter context, but when I checked in app/helpers/queries_helper.rb, I found that the variable content is not updated. So what's the proper way of using this hook? My guess is that this piece of code:

    call_hook(:helper_queries_column_value,
              {:content => content, :column => column, :item => item, :value => value})

    content

should be revised to:

    content = call_hook(:helper_queries_column_value,
              {:content => content, :column => column, :item => item, :value => value})

    content
Actions

Also available in: Atom PDF