Created
July 25, 2011 03:47
-
-
Save sher/1103528 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Equipment model | |
class Equipment < ActiveRecord::Base | |
def price | |
read_attribute(:price).to_i | |
end | |
end | |
# Form _form.erb | |
<%= f.fields_for :equipment do |builder| -%> | |
<%= render "equipment_fields", :f => builder %> | |
<% end %> | |
# Partial _equipment_fields.erb | |
<div class="equipment_fields"> | |
<%= f.text_field :price %> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment