Thank you to anyone who has already donated - your generous donations helped make three months of treatment possible.
My brother Nate continues to fight stage IV Hodgkin's lymphoma. He's just 31, with a wife and baby girl. They have no active income (since he's been unable to return to work), no insurance, and cannot afford the treatment he needs. Nate and his family need your help. Please consider a donation, every dollar helps. Thanks.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
@project = Project.new 1.upto(1) {@project.photos.build } @project_category = ProjectCategory.all end @project_category = ProjectCategory.all @project = Project.new(params[:project]) if @project.save flash[:notice] = "Successfully created project." redirect_to @project else render :action => 'new' end end @project = Project.find(params[:id]) @project_category = ProjectCategory.all if @project.photos.first.nil? 1.upto(1) {@project.photos.build } end end @project = Project.find(params[:id]) if @project.update_attributes(params[:project]) flash[:notice] = "Successfully updated project." redirect_to @project else render :action => 'edit' end end |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
<% form_for @project, :html => {:multipart => true} do |f| %> <%= f.error_messages %> <p> <%= f.label :projectName %><br /> <%= f.text_field :projectName %> </p> <p> <%= f.label :description %><br /> <%= f.text_area :description, :rows => 2 %> </p> <%= f.label :category_id, "Type"%><br /> <% @project_category.each do |cat|%> <%= f.radio_button :project_category_id, cat.id %> <%= cat.id%> <%= cat.title %> <% end %> <div class="album_photos"> <%= render :partial => 'project_photo', :collection => @project.photos %> </div> <div id="photos"> <%= render :partial => 'photo', :collection => @project.photos %> </div> <%= link_to_function "Add Photo" do |page| page.insert_html :bottom, :photos, :partial => 'photo', :object => Photo.new end %> <p><%= f.submit "Submit" %></p> <% end %> |
1 2 3 4 |
<% unless project_photo.new_record? %> <%= image_tag(project_photo.data.url(:thumb), :alt => project_photo.description) %> <%= check_box_tag "photo_ids[]", project_photo.id %> <% end rescue nil %> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<div class="photo"> <fieldset> <% fields_for "project[photo_attributes][]", photo do |p| %> <p> <%= p.label :Photo %><br /> <%= p.file_field :data, :index => nil %> <%= link_to_function "delete", "remove_field($(this), ('.photo'))" %> </p> <p> <%= p.text_field :description </p> <% end %> </fieldset> </div> |
1 2 3 4 5 6 7 8 9 10 |
end |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
end |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
end |