简体   繁体   中英

Rails 3 custom yaml file

I want to read variables from yaml file. I tried this Railscast but it is not working because I use Rails 3.2. Also I tried this topic again I saw that it is not working.

How can I read some variables from custom yaml file?

you can use the rails config gem as pointed out in this answer .

edit: fot rails 3 you better use this approach: https://stackoverflow.com/a/5053882/532102

I solved the problem with starting server again. However, there was an error again. The path of config file was wrong. I fixed it and everything is working now. I used this post.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM