I would override the "body" method on the appropriate model to return
read_attribute(:body).html_safe!
W
On 7/10/10 4:46 PM, stephen murdoch wrote:
yeah, I've been playing around with html_safe and 'raw' in other
rails3 apps but I can't figure out a way to tell active_scaffold to
implement those methods on my tiny_mce editor field
I was thinking that something like this in my controller would work:
config.columns[:body].options = {:html_safe => true}
but it does not.
I tried to add a helper method to posts_helper.rb, something like
this:
def body_form_column(record, input_name)
text_editor(:record, :body, :html_safe => true, :name=>
input_name)
end
But again, no luck
On Jul 10, 11:57 pm, Wes Gamble<[email protected]> wrote:
Check out the html_safe! method on String in Rails 3 which allows you to
turn off the auto-escaping of rendered text.
W
On 7/10/10 3:12 PM, stephen murdoch wrote:
I have tiny_mce plugin installed and I'm using the rails3 branch of
ActiveScaffold that someone posted a while back
Almost everything is working perfectly except for one small thing.
When I hit the create button, the text area that renders should be a
tiny_mce textarea but instead of a text-area I get a printout of the
escaped javascript:
i.e.<textarea class="body-input mceEditor" id="record_body_"
name="record[body]"></textarea> <script type="text/javascript"> //<!
[CDATA[ tinyMCE.execCommand('mceAddControl', false,
'record_body_'); //]]> </script>
Is there a way to prevent this from happening? Is it because rails3
automatically escapes js
--
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.