Take the 2-minute tour ×

I'm using vhochstein's fork of active_scaffold, which runs quite nicely on rails 3, except for a few small bugs - http://github.com/vhochstein/active_scaffold.

In rails 2.3, the following code disables a link:

return "<a class='disabled'>#{text}</a>" unless authorized

But in Rails 3, it causes the escaped html tags to be printed out instead as in the following photo:


How can I make the content of this return statement render the way it should in rails 3?

The code above, is from the list_column_helpers.rb file in vendor/plugins/active_scaffold/helpers/


Floatless fixed this by suggesting to add .html_safe to the code.

I have since found that the folowing change also needs to be made as there's more than one bit of code that is respondible for disabling action links in active_Scaffold:

In /plugins/active_scaffold/frontends/default/views/_list_actions.html.erb change:

<%= record.authorized_for?(:crud_type => etc etc etc -%>

By making it use "raw"


<%= raw record.authorized_for?(:crud_type => etc etc etc -%>

Anyway, thanks to floatless and hopefully mr hochstein will be able to use this stuff.

share|improve this question

1 Answer 1

up vote 10 down vote accepted

Try this:

return "<a class='disabled'>#{text}</a>".html_safe unless authorized
share|improve this answer
awesome! you fixed it. I've emailed the gitrepo owner to let him know about the thread so he can incorporate it into his code. thanks a lot –  marflar Aug 1 '10 at 14:27
I forked active_scaffold and added the fixes github.com/murdoch/active_scaffold –  marflar Aug 1 '10 at 15:01

Your Answer


