From 335bd9c96aeb530e688fd4330dde03c85f6dbedc Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 27 Oct 2010 12:53:46 -0700 Subject: [PATCH] skip getting started button sets getting_started to false via js and redirects to root_path --- app/controllers/users_controller.rb | 5 ++--- app/views/users/getting_started.html.haml | 12 ++++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 3ecf933b1..21182fd94 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -22,7 +22,6 @@ class UsersController < ApplicationController @user = current_user if params[:user][:getting_started] - puts "here" boolean = params[:user][:getting_started] == "true" @user.update_attributes( :getting_started => boolean ) redirect_to root_path @@ -38,9 +37,9 @@ class UsersController < ApplicationController flash[:error] = "Password Change Failed" end end - end - redirect_to edit_user_path(@user) + redirect_to edit_user_path(@user) + end end def destroy diff --git a/app/views/users/getting_started.html.haml b/app/views/users/getting_started.html.haml index 6f69c8de2..71bc63dd0 100644 --- a/app/views/users/getting_started.html.haml +++ b/app/views/users/getting_started.html.haml @@ -3,6 +3,18 @@ -# the COPYRIGHT file. +- if current_user.getting_started == true + :javascript + $("#getting_started_skip").live("click", function(evt){ + evt.preventDefault(); + $.ajax({ + type: "PUT", + url: "/users/#{current_user.id}", + data: {"user":{"getting_started":'false'}}, + success: function() { window.location = "#{root_path}"} + }) + }); + .span-8.append-1.last %h1{:style => "text-align:right;"} = "Welcome to Diaspora!"