adding a caption by a form field?

13 views
Skip to first unread message

Adam Spiers

unread,
Jan 14, 2012, 7:21:46 AM1/14/12
to actives...@googlegroups.com
Two of my ActiveScaffold-controlled models have fields which I have configured to be edited via <textarea>, and they are intended to receive Markdown-formatted text, so I wish to provide a link to http://daringfireball.net/projects/markdown/syntax at the top or bottom of the <textarea> in the #edit form.  How can I do this with ActiveScaffold?  I couldn't find anything in the docs; maybe I missed it.

Thanks,
Adam

Sergio Cambra

unread,
Jan 16, 2012, 4:45:16 AM1/16/12
to actives...@googlegroups.com

You could set description, something like
conf.columns[:markdown_column].description = '<a
href="http://daringfireball.net/projects/markdown/syntax"
target="_blank">markdown syntax</a>'.html_safe

Adam Spiers

unread,
Jan 16, 2012, 5:53:51 PM1/16/12
to actives...@googlegroups.com

Thanks! That works ... but it also tries to insert the same
HTML into the <th> for that column in the #list action, which
causes serious HTML syntax / validation errors. Any ideas?

Sergio Cambra

unread,
Jan 17, 2012, 3:25:35 AM1/17/12
to actives...@googlegroups.com

you can override render_column_heading

Sergio Cambra

unread,
Jan 17, 2012, 3:26:44 AM1/17/12
to actives...@googlegroups.com
On Lunes, 16 de enero de 2012 22:53:51 Adam Spiers escribió:

you can override render_column_heading from list_column_helpers to remove
column.description from title attribute, or you can override form field to add
the link without using column.description

Reply all
Reply to author
Forward
0 new messages