DG IZ photo upload form now with all the others
This commit is contained in:
parent
10e01c0a94
commit
e08ed8805f
5 changed files with 14 additions and 5 deletions
|
|
@ -1,8 +1,5 @@
|
||||||
class Photo < Post
|
class Photo < Post
|
||||||
require 'carrierwave/orm/mongomapper'
|
require 'carrierwave/orm/mongomapper'
|
||||||
include MongoMapper::Document
|
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
|
mount_uploader :image, ImageUploader
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
%li{ :class => "status_message" }= link_to "status message", "#"
|
%li{ :class => "status_message" }= link_to "status message", "#"
|
||||||
%li{ :class => "bookmark" }= link_to "bookmark", "#"
|
%li{ :class => "bookmark" }= link_to "bookmark", "#"
|
||||||
%li{ :class => "blog" }= link_to "blog", "#"
|
%li{ :class => "blog" }= link_to "blog", "#"
|
||||||
|
%li{ :class => "photo" }= link_to "photo", "#"
|
||||||
|
|
||||||
#publisher_form
|
#publisher_form
|
||||||
= form_for StatusMessage.new, :remote => true do |f|
|
= form_for StatusMessage.new, :remote => true do |f|
|
||||||
|
|
@ -37,3 +38,11 @@
|
||||||
= f.text_area :body
|
= f.text_area :body
|
||||||
%p
|
%p
|
||||||
= f.submit "Post"
|
= 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'
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
$("#publisher_content_pickers .status_message").click(selectPublisherTab);
|
$("#publisher_content_pickers .status_message").click(selectPublisherTab);
|
||||||
$("#publisher_content_pickers .bookmark").click(selectPublisherTab);
|
$("#publisher_content_pickers .bookmark").click(selectPublisherTab);
|
||||||
$("#publisher_content_pickers .blog").click(selectPublisherTab);
|
$("#publisher_content_pickers .blog").click(selectPublisherTab);
|
||||||
|
$("#publisher_content_pickers .photo").click(selectPublisherTab);
|
||||||
|
|
||||||
function selectPublisherTab(evt){
|
function selectPublisherTab(evt){
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
|
|
|
||||||
|
|
@ -281,7 +281,8 @@ label {
|
||||||
|
|
||||||
#new_blog,
|
#new_blog,
|
||||||
#new_bookmark,
|
#new_bookmark,
|
||||||
#new_status_message {
|
#new_status_message,
|
||||||
|
#new_photo {
|
||||||
display: none; }
|
display: none; }
|
||||||
|
|
||||||
ul#publisher_content_pickers {
|
ul#publisher_content_pickers {
|
||||||
|
|
|
||||||
|
|
@ -330,7 +330,8 @@ label
|
||||||
|
|
||||||
#new_blog,
|
#new_blog,
|
||||||
#new_bookmark,
|
#new_bookmark,
|
||||||
#new_status_message
|
#new_status_message,
|
||||||
|
#new_photo
|
||||||
:display none
|
:display none
|
||||||
|
|
||||||
ul#publisher_content_pickers
|
ul#publisher_content_pickers
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue