MS RS fixed real name, now profiles are created with a new friend

This commit is contained in:
maxwell 2010-06-29 20:33:55 -07:00
parent 984f5f62b6
commit 448fcf8f89
6 changed files with 31 additions and 5 deletions

View file

@ -20,10 +20,15 @@ class FriendsController < ApplicationController
def new
@friend = Friend.new
@profile = Profile.new
end
def create
puts params.inspect
@friend = Friend.new(params[:friend])
if @friend.save
flash[:notice] = "Successfully created friend."
redirect_to @friend

View file

@ -26,7 +26,7 @@ class Person
before_validation :clean_url
def real_name
self.profile.first_name + " " + self.profile.last_name
profile.first_name + " " + profile.last_name
end

View file

@ -10,7 +10,17 @@
= f.label :url
%br
= f.text_field :url
%p
=f.fields_for :profile do |p|
%p
= p.label :first_name
%br
= p.text_field :first_name
%p
= p.label :last_name
%br
= p.text_field :last_name
= f.submit

View file

@ -12,6 +12,10 @@
%b Last Name
%p
= @friend_profile.last_name
%p
%b url
%p
= @friend.url
%br
%br

View file

@ -42,7 +42,12 @@
var obj = jQuery.parseJSON(evt.data);
debug("got a " + obj['class']);
if((location.href.indexOf(obj['class']) != -1 ) || (location.pathname == '/')) {
$("#stream").prepend($(obj['html']).fadeIn("fast"));
$("#stream").prepend(
$(obj['html']).fadeIn("fast", function(){
$("#stream label:first").inFieldLabels();
}
)
);
};
};
ws.onclose = function() { debug("socket closed"); };
@ -59,7 +64,6 @@
});
// in field label plugin
$("label").inFieldLabels();
$(".show_post_comments").click( function() {
$(this).parents("li").children(".comments").fadeIn(100);

View file

@ -46,8 +46,11 @@ $(document).ready(function(){
});
});
$("label").inFieldLabels();
$('#flash_notice, #flash_error, #flash_alert').delay(1500).slideUp(130);
$('#flash_notice, #flash_error, #flash_alert').delay(1500).slideUp(130);
});//end document ready