H- Undefined Method?

I know you can use the method h() to HTMLEdit varible, but ruby doesn’t
seem to think it exists when I did this:
@a_user.firstname = h(params[:firstname])
It gave me this error:
undefined method `h’ for #JoinController:0xb7b1c508
What’s wrong? I know That the method is defined. Thanks, sorry for all
the stupid questions, but I am new from CF and i is worlds apart from
Ruby.
P.S I am using @a_user.firstname within the creation of a db row.

Ben V. wrote:

I know you can use the method h() to HTMLEdit varible, but ruby doesn’t
seem to think it exists when I did this:

Ruby does not have a built-in ‘h’ method. Are you using an
additional framework or third-party libraries?


James B.

http://www.ruby-doc.org - Ruby Help & Documentation
Ruby Code & Style - The Journal By & For Rubyists
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://refreshingcities.org - Design, technology, usability

Sorry, yes, Rails. What method could I use instead? Not really familliar
with ther methods; I’m pretty new to Rails/Ruby. But still, it should
work in a controller file.Thanks,
Ben.

Ben V. wrote:

Sorry, yes, Rails. What method could I use instead? Not really familliar
with ther methods; I’m pretty new to Rails/Ruby. But still, it should
work in a controller file.Thanks,

  1. I think that method works only in helper code or in views, but not
    (by default) in controllers.

  2. Please ask rails questions on the rails mailing list.

http://lists.rubyonrails.org/mailman/listinfo/rails


James B.

“Inside every large system there’s a small system trying to get out”.
- Chet Hendrickson

Rimantas L. wrote:

Ben V. wrote:

I know you can use the method h() to HTMLEdit varible, but ruby doesn’t
seem to think it exists when I did this:

Ruby does not have a built-in ‘h’ method. Are you using an
additional framework or third-party libraries?

‘h’ method comes from ERB::Util
http://ruby-doc.org/core/classes/ERB/Util.html

Regards,
Rimantas

Thanks, I’m not used to having to call additional modules or classes
from my native CF.

Ben V. wrote:

I know you can use the method h() to HTMLEdit varible, but ruby doesn’t
seem to think it exists when I did this:

Ruby does not have a built-in ‘h’ method. Are you using an
additional framework or third-party libraries?

‘h’ method comes from ERB::Util
http://ruby-doc.org/core/classes/ERB/Util.html

Regards,
Rimantas