On Feb 18, 11:44 am, "Sergio Cambra .:: entreCables S.L. ::."
<[email protected]> wrote:
> On Jueves, 18 de Febrero de 2010 16:41:36 Pusillanimous Coward escribió:
>
> > From October 2009:
>
> >       def active_scaffold_show_text(column, record)
> >         simple_format(get_column_value(record, column))
> >       end
>
> > From February 2010:
>
> >       def active_scaffold_show_text(column, record)
> >         simple_format(clean_column_value(record.send(column.name)))
> >       end
>
> > The latest active_scaffold_show_text does not call the helper.
> > Replacing it with the older one DOES call the helper.
>
> That change was to truncate long texts in list and show full long texts in
> show. If you want to get your helper called, make a show override, which is
> exactly what you need.
>
>
>
>
>
> > In addition, I wanted to fix a separate problem- that when my helper
> > put the text in a text box, the text was decorated with html.  This
> > was due to always calling simple_format for text.  So, I further
> > changed the method to figure out if a helper is being used, and not to
> > call simple_format in that case.
>
> >       def active_scaffold_show_text(column, record)
> >         if override_show_column_ui?(column.column.type)
> >           get_column_value(record, column)
> >         else
> >           simple_format(clean_column_value(record.send(column.name)))
> >         end
> >       end
>
> > I hope this helps.
>
> Again, that code is the same as remove active_scaffold_show_text,
> active_scaffold_show_text is called when override_show_column_ui?
> (column.column.type) is true, so every time active_scaffold_show_text is 
> called
> override_show_column_ui?(column.column.type) will be true, and always will use
> get_column_value.
>
> Also I don't think we need patch active_scaffold_show_text to use a field
> override (data_column is a field override called from get_column_value) when
> you can use a show override.
>
> So, please, try renaming data_column to data_show_column, or duplicating
> data_column as data_show_column, or making an alias from data_column to
> data_show_column, and let me know if it doesn't work
>
> --
> Sergio Cambra .:: entreCables S.L. ::.
> Mariana Pineda 23, 50.018 Zaragoza
> T) 902 021 404 F) 976 52 98 07 E) [email protected]

Changing the name of the helper from data_column to data_show_column
worked perfectly.

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.

Reply via email to