Wednesday, August 5th, 2009
Do you have usernames, passwords or other configuration values mixed with code in your Ruby on Rails application? A YAML file will help keep these values out of your code. For example, I use YAML:load to load and parse my twitter.yml file stored in the config folder. The twitter.yml file contains the credentials for the [...]
Tuesday, August 4th, 2009
I’ve learned a lot from transitioning from PHP to Ruby on Rails. One thing I loved about Rails was the separation of configuration and code. Rails stores it’s database configuration into a small text file written in YAML and organizes this in it’s own config folder. The following is about how I used YAML in [...]
Friday, July 3rd, 2009
This is the code that I got from the Rails API, however, the value was processed as an HTML attribute rather than the value of the radio button.
<% form_for @review do f %>
<%= f.label :rating, 1, :value => 1 %>
<%= f.radio :rating, 1 %>
<% end %>
Undesired output:
<label for=”review_rating” value=”1″>1</label>
<input id=”review_rating_1″ name=”rating” [...]