DG IZ photo upload form now with all the others

This commit is contained in:
ilya 2010-07-20 10:00:02 -07:00
parent 10e01c0a94
commit e08ed8805f
5 changed files with 14 additions and 5 deletions

View file

@ -1,8 +1,5 @@
class Photo < Post
require 'carrierwave/orm/mongomapper'
include MongoMapper::Document
before_validation {puts "I'M GONNA VALIDATE"}
before_save {puts "I'M GONNA SAVE"}
before_create {puts "I'M GONNA CREATE"}
mount_uploader :image, ImageUploader
end

View file

@ -6,6 +6,7 @@
%li{ :class => "status_message" }= link_to "status message", "#"
%li{ :class => "bookmark" }= link_to "bookmark", "#"
%li{ :class => "blog" }= link_to "blog", "#"
%li{ :class => "photo" }= link_to "photo", "#"
#publisher_form
= form_for StatusMessage.new, :remote => true do |f|
@ -37,3 +38,11 @@
= f.text_area :body
%p
= f.submit "Post"
= form_for Photo.new, :html => {:multipart => true} do |f|
= f.error_messages
%p
%label{:for => "image_form"} Image
= f.file_field :image
%p
= f.submit 'post it!', :class => 'button'

View file

@ -3,6 +3,7 @@
$("#publisher_content_pickers .status_message").click(selectPublisherTab);
$("#publisher_content_pickers .bookmark").click(selectPublisherTab);
$("#publisher_content_pickers .blog").click(selectPublisherTab);
$("#publisher_content_pickers .photo").click(selectPublisherTab);
function selectPublisherTab(evt){
evt.preventDefault();

View file

@ -281,7 +281,8 @@ label {
#new_blog,
#new_bookmark,
#new_status_message {
#new_status_message,
#new_photo {
display: none; }
ul#publisher_content_pickers {

View file

@ -330,7 +330,8 @@ label
#new_blog,
#new_bookmark,
#new_status_message
#new_status_message,
#new_photo
:display none
ul#publisher_content_pickers