Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## The setup
- *bonus has_one photo, photo belongs_to bonus
- *i've confirmed @bonus is not nil at this point
- ## The question
- why does it say 'nil_class' instead of 'bonus' or 'photo' or something nice?
- ## The View
- <% form_for(@bonus, :html => { :multipart => true }) do |f| %>
- <% fields_for @bonus.photo do |photo_field| %>
- image file: <%= photo_field.file_field :uploaded_data %>
- <% end %>
- ...other regular bonus fields...
- <%= f.submit "Update" %>
- <% end %>
- ## The Resulting HTML
- <h2>Upload a new photo</h2>
- image file: <input id="nil_class_uploaded_data" name="nil_class[uploaded_data]" size="30" type="file" />
- ## The clean pastie knowledge-gain acknowledgment
- um, thanks leeth, yer the shit
Add Comment
Please, Sign In to add comment