Closed GoogleCodeExporter closed 9 years ago
Do you have helper :all in your ApplicationController?
Original comment by sergio.c...@gmail.com
on 20 May 2010 at 7:09
Sorry, I was confused about patching list_column_helpers, I thought you want to
override in text1 list without overriding in text2 list.
You can define your helper and check record's class is Text2:
def body_column(record)
if record.is_a? Text2
...
else
...
end
end
Is it enough for you?
Original comment by sergio.c...@gmail.com
on 20 May 2010 at 7:19
You're right, this should gain the same results and we need no patch.
Anyway, it will be cool if the code in 'list_column_helpers.rb -
get_column_value'
method actually checked the availability of the methods in the helpers, which
are
appropriate for the given records. It will then be much cleaner and I'll need
only to
create a 'body_column' method in text2 helper.
Thanks for your reply.
Original comment by r.stu...@googlemail.com
on 20 May 2010 at 8:07
Helpers are included in an ActionView::Base instance, so you can't define
body_column in two helper modules and include them, because method from second
helper will override first one.
Original comment by sergio.c...@gmail.com
on 20 May 2010 at 8:13
You can call the different helper methods using this mechanism:
Text1Controller.helpers.body_column
or
Text2Controller.helpers.body_column
You only need to take care to have the helpers proxy populated with the right
things.
Original comment by r.stu...@googlemail.com
on 20 May 2010 at 8:23
Now helpers are prefixed with class name, old naming schema continues working
but it's deprecated
Original comment by sergio.c...@gmail.com
on 26 Jul 2010 at 10:03
Original issue reported on code.google.com by
r.stu...@googlemail.com
on 19 May 2010 at 10:19Attachments: