From 8619584834738b5a3b1abae8765c3f2f830eff89 Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 17 Aug 2010 18:27:50 -0700 Subject: [PATCH] things mostly working --- app/controllers/application_controller.rb | 1 - app/models/user.rb | 5 ++--- app/views/devise/registrations/new.html.haml | 2 +- config/routes.rb | 12 ++++++------ 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index c3b74a861..b4543f22d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,7 +1,6 @@ class ApplicationController < ActionController::Base protect_from_forgery :except => :receive - layout 'application' before_filter :set_friends_and_status, :count_requests diff --git a/app/models/user.rb b/app/models/user.rb index 495829fe8..9b43eb3c4 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -2,8 +2,7 @@ class User include MongoMapper::Document devise :database_authenticatable, :registerable, - :recoverable, :rememberable, :trackable, :validatable, - :confirmable + :recoverable, :rememberable, :trackable, :validatable key :friend_ids, Array key :pending_request_ids, Array @@ -304,7 +303,7 @@ class User def setup_person self.person.serialized_key ||= generate_key.export self.person.email = email - self.person.save + self.person.save! end def generate_key diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml index 7491611f3..dd50d306a 100644 --- a/app/views/devise/registrations/new.html.haml +++ b/app/views/devise/registrations/new.html.haml @@ -14,7 +14,7 @@ = f.password_field :password_confirmation = f.fields_for :person do |p| - = p.hidden_field :url, :value => request.path + = p.hidden_field :url, :value => request.host = p.fields_for :profile do |pr| %p diff --git a/config/routes.rb b/config/routes.rb index 59bb8b720..64dbb927e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,7 +2,7 @@ Diaspora::Application.routes.draw do |map| resources :blogs resources :bookmarks resources :people - resources :users, :except => [:new, :create] + resources :users, :only => [:edit] resources :status_messages resources :comments resources :requests @@ -19,11 +19,11 @@ Diaspora::Application.routes.draw do |map| #routes for devise, not really sure you will need to mess with this in the future, lets put default, #non mutable stuff in anohter file - devise_for :users do - match 'login', :to => 'devise/sessions#new' - match 'logout', :to => 'devise/sessions#destroy' - match 'get_to_the_choppa', :to => 'devise/registrations#new' - end + devise_for :users + match 'login', :to => 'devise/sessions#new', :as => "new_user_session" + match 'logout', :to => 'devise/sessions#destroy', :as => "destroy_user_session" + match 'get_to_the_choppa', :to => 'devise/registrations#new', :as => "new_user_registration" + #public routes # match 'webfinger', :to => 'publics#webfinger'