major hack on getting_started#2 with aspect javascript. reload the page on ajax success on new aspect creation just to get it working.

This commit is contained in:
danielvincent 2010-10-27 18:08:55 -07:00
parent 05c5e770ee
commit db1a753add
4 changed files with 28 additions and 11 deletions

View file

@ -47,7 +47,7 @@ class AspectsController < ApplicationController
def show
@aspect = current_user.aspect_by_id params[:id]
@friends_not_in_aspect = current_user.friends_not_in_aspect(@aspect)
@friends_not_in_aspect = current_user.friends #current_user.friends_not_in_aspect(@aspect)
unless @aspect
render :file => "#{Rails.root}/public/404.html", :layout => false, :status => 404
else

View file

@ -3,6 +3,17 @@
-# the COPYRIGHT file.
- content_for :head do
:javascript
$("#new_aspect").live("ajax:success", function(data,stat,xhr){
window.location.reload();
});
$(".aspects li").find(".delete").live("click", function(){
var aspectElement = $(this).parent("li");
aspectElement.fadeOut(300, function(){aspectElement.remove();});
});
- if current_user.getting_started == true
:javascript
$("#getting_started_skip").live("click", function(evt){

View file

@ -10,7 +10,7 @@
%h4
Aspect name
- form_for Aspect.new, :remote => true do |aspect|
- form_for Aspect.new, :remote => true, :format => :json do |aspect|
= aspect.text_field :name, :style => "display:inline;"
= aspect.submit "Add"

View file

@ -1355,3 +1355,9 @@ ul.aspects
:position absolute
:left 12px
:bottom 12px
#user_photo_uploader
.avatar
:border-radius 5px
:height 100px
:width 100px