MS figured out how to get comments to come thru the websocket. this is super super super hacky, and kind of terrible, but it works

This commit is contained in:
maxwell 2010-06-28 17:35:38 -07:00
parent 3dce5f1b34
commit 36b5a90d34
6 changed files with 15 additions and 10 deletions

View file

@ -3,7 +3,7 @@ module StatusMessagesHelper
def my_latest_message
message = StatusMessage.my_newest
unless message.nil?
return message.message + " " + how_long_ago(message)
return message.message + " - " + how_long_ago(message)
else
return "No message to display."
end

View file

@ -1,6 +1,5 @@
= form_tag("/comments",:remote => true, :class =>"new_comment", :id => "new_comment") do
= form_tag("/comments", :remote => true, :class =>"new_comment", :id => "new_comment-#{post.id}") do
%p
= text_field_tag "comment_text", 'dislike!', :size => 30, :name => 'comment[text]'
= hidden_field_tag "comment_post_id", "#{post.id}", :name => "comment[post_id]"
= submit_tag 'comment', :id => "comment_submit", :name => "commit"
= submit_tag 'comment', :id => "comment_submit_#{post.id}", :name => "commit"

View file

@ -8,7 +8,7 @@
= stylesheet_link_tag "blueprint/screen", :media => 'screen'
= stylesheet_link_tag "application"
/= javascript_include_tag"http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"
/= javascript_include_tag"http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"
= javascript_include_tag 'jquery142', 'rails', 'view'
= javascript_include_tag 'tiny_mce/tiny_mce.js'

View file

@ -4,7 +4,7 @@
= post.message
%div.time
= link_to(how_long_ago(post), status_message_path(post))
/= render "comments/comments", :post => post
= render "comments/comments", :post => post
- if mine?(post)
= link_to 'Destroy', status_message_path(post), :confirm => 'Are you sure?', :method => :delete

View file

@ -11,7 +11,12 @@ module WebSocket
class << @view
include ApplicationHelper
include Rails.application.routes.url_helpers
#include ActionView::Helpers::FormTagHelper
include ActionController::RequestForgeryProtection::ClassMethods
include ActionView::Helpers::FormTagHelper
include ActionView::Helpers::UrlHelper
def protect_against_forgery?
false
end
end
end
@ -36,13 +41,13 @@ module WebSocket
v = WebSocket.view_for(object)
puts v.inspect
rescue Exception > e
rescue Exception => e
puts "in failzord " + v.inspect
puts object.inspect
puts e.inspect
puts e.message
raise e
end
puts "i made it here"
{:class =>object.class.to_s.underscore.pluralize, :html => v}
end

View file

@ -30,6 +30,7 @@ $(document).ready(function(){
$('#bookmark_title').click(clearForm);
$('#bookmark_link').click(clearForm);
$('#debug_more').hide();
function clearForm(){
$(this).val("");