Rails, use the content of file in the controller

Posted by Denis on Stack Overflow See other posts from Stack Overflow or by Denis
Published on 2010-04-07T12:42:08Z Indexed on 2010/04/07 12:43 UTC
Read the original article Hit count: 168

Filed under:

Hi,

I've a file in the config directory, let's say my_policy.txt. I want to use the content of that file in my controller like a simple string.

@policy = #content of /config/my_policy.txt

How to achieve that goal, does rails provide it's own way to do that?

Thanks

© Stack Overflow or respective owner

Related posts about ruby-on-rails